有没有办法在没有root权限的情况下以编程方式应答Android 7.0中的来电?我尝试了以下方式接听来电。
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
Class<?> c = Class.forName(tm.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
Object telephonyService = m.invoke(tm);
Class<?> telephonyServiceClass = Class.forName(telephonyService.getClass().getName());
Method endCallMethod = telephonyServiceClass.getDeclaredMethod("answerRingingCall");
endCallMethod.invoke(telephonyService);
Run Code Online (Sandbox Code Playgroud) 当用户设置特定的预定时间时,我需要在页面上自动发布.我尝试使用Graph api和以下请求:
Bundle params1 = new Bundle();
params1.putString("message", "This is a system generated post");
params1.putString("scheduled_publish_time",(date.getTime()+(1000*60*30))""); //for current time to next 30 min
params1.putBoolean("published", false);
new GraphRequest(
accessToken,
"/850285671748182/feed",
params1,
HttpMethod.POST,
new GraphRequest.Callback() {
public void onCompleted(GraphResponse response) {
/* handle the result */
Log.d("Response-auto", "DATA" + response);
}
}
).executeAsync();
Run Code Online (Sandbox Code Playgroud)
但它给出了以下回应.
{"error": {"message": "(#100) The specified scheduled publish time is invalid.",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "HcuHy8cusGC"}}
Run Code Online (Sandbox Code Playgroud) android facebook facebook-graph-api android-facebook facebook-share
我正在使用LG Nexus(6.0)。当我使用相机使用以下代码捕获视频时。
Intent intent = new Intent(MediaStore.ACTION_VIDEO_CAPTURE);
fileUri = getOutputMediaFileUri(MEDIA_TYPE_VIDEO);
// set video quality
intent.putExtra(MediaStore.EXTRA_VIDEO_QUALITY, 1);
intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 30);
intent.putExtra(MediaStore.EXTRA_OUTPUT, fileUri);
Run Code Online (Sandbox Code Playgroud)
我使用下面的代码给出了它的持续时间限制。
intent.putExtra(MediaStore.EXTRA_DURATION_LIMIT, 30);
Run Code Online (Sandbox Code Playgroud)
相机似乎忽略了持续时间限制。在任何6.0设备上,它均不起作用。还有另一种方法来限制6.0 +设备上的捕获视频持续时间吗?
我们如何检查Android设备上的选定语言支持?或如何在Android设备中获取当前支持的语言
我需要帮助来获取我们通过 Intent 从下载文件夹或任何其他文件夹中选择的内容的文件路径。我附上了一个我一直在使用的fileUtil类,它在牛轧糖版本之前运行良好。但是对于奥利奥以及在某些特定设备中也是如此,我们会收到一个空路径作为回报。因此,如果有人遇到过此类错误并找到了解决方案,请在此处分享。
if(resultCode ==RESULT_OK)
{
final Uri uri = data.getData();
// Get the File path from the Uri
String path = FileUtils.getPath(this, uri);
// Alternatively, use FileUtils.getFile(Context, Uri)
if (path != null && FileUtils.isLocal(path)) {
//File file = new File(path);
this.file = new File(path);
profile_imagepath = path;
filename = file.getName();
txtselectedfile.setText(filename);
}
}
Run Code Online (Sandbox Code Playgroud) android ×4
android-file ×1
call ×1
facebook ×1
file ×1
locale ×1
localization ×1
uri ×1
video ×1