首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到处理意图com.android.phone.videocall的活动

找不到处理意图com.android.phone.videocall的活动
EN

Stack Overflow用户
提问于 2012-08-20 23:24:11
回答 2查看 2.2K关注 0票数 0

我正在尝试开始视频呼叫,但每次都收到此错误

代码语言:javascript
复制
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)

下面是我的代码:

代码语言:javascript
复制
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。任何帮助都将不胜感激。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2012-08-20 23:32:36

这意味着您的电话上没有安装任何可以处理视频呼叫的应用程序。

这就是为什么当调用外部活动时,将所有代码包装在一个try()catch{}块中总是很好的,因为你不能依赖于用户会安装这样的应用程序。

票数 0
EN

Stack Overflow用户

发布于 2018-11-10 01:53:02

虽然try-catch可以工作,但我建议使用现有的安卓工具来检查是否可以处理隐式Intent

代码语言:javascript
复制
if (callIntent.resolveActivity(getPackageManager()) != null) {
    // Send the intent, it's safe
} else{
    // There is nothing that can handle this Intent
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/12040516

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档