我正在尝试开始视频呼叫,但每次都收到此错误
E/AndroidRuntime(668): android.content.ActivityNotFoundException: No Activity found to handle Intent { act=com.android.phone.videocall dat=tel:xxx-xxx-xxxx (has extras) }
E/AndroidRuntime(668): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1409)
E/AndroidRuntime(668): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1379)
E/AndroidRuntime(668): at android.app.Activity.startActivityForResult(Activity.java:2827)
E/AndroidRuntime(668): at android.app.Activity.startActivity(Activity.java:2933)下面是我的代码:
Intent callIntent = new Intent("com.android.phone.videocall");
callIntent.putExtra("videocall", true);
callIntent.setData(Uri.parse("tel:" + prefs.getString("videonumber", "")));
startActivity(callIntent); 在我的清单中,我有<uses-permission android:name="android.permission.CALL_PHONE"/>权限。我以为这就是你所需要的,但也许我错了。我的videonumber的格式是1-xxx-xxx-xxxx。任何帮助都将不胜感激。
发布于 2012-08-20 23:32:36
这意味着您的电话上没有安装任何可以处理视频呼叫的应用程序。
这就是为什么当调用外部活动时,将所有代码包装在一个try()catch{}块中总是很好的,因为你不能依赖于用户会安装这样的应用程序。
发布于 2018-11-10 01:53:02
虽然try-catch可以工作,但我建议使用现有的安卓工具来检查是否可以处理隐式Intent:
if (callIntent.resolveActivity(getPackageManager()) != null) {
// Send the intent, it's safe
} else{
// There is nothing that can handle this Intent
}https://stackoverflow.com/questions/12040516
复制相似问题