意向行动电话在Android中5 [英] Intent Action Call in Android 5

查看:227
本文介绍了意向行动电话在Android中5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个code,工作正常的Andr​​oid 4.4系统和previous:

I have this code, that works fine in Android 4.4 and previous:

Intent intent = new Intent(Intent.ACTION_CALL);

    intent.setPackage("com.android.phone");

    intent.setData(Uri.parse("tel:" + number));
    context.startActivity(intent);

现在,在安卓5.0棒棒堂本code不工作,并显示出此异常:

Now, in Android 5.0 Lollipop this code doesn't work, and shows this exception:

致命异常:android.content.ActivityNotFoundException 无活动处理意向{行动= android.intent.action.CALL DAT =电话:XXXXXXXXX PKG = com.android.phone}

Fatal Exception: android.content.ActivityNotFoundException No Activity found to handle Intent { act=android.intent.action.CALL dat=tel:xxxxxxxxx pkg=com.android.phone }

在这个文件的意图不会出现pcated德$ P $: HTTP ://developer.android.com/reference/android/content/Intent.html

In the documentation this intent doesn't appear deprecated: http://developer.android.com/reference/android/content/Intent.html

你知道吗?在此先感谢

推荐答案

好像包的名称已改为com.android.phone到com.android.server.telecom。

Seems like the package name has been changed from "com.android.phone" to "com.android.server.telecom".

希望这有助于!

这篇关于意向行动电话在Android中5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆