Android 5中的意图动作调用

Android 5中的意图动作调用,第1张

概述我有这个代码,在Android4.4和之前的版本中工作正常:Intentintent=newIntent(Intent.ACTION_CALL);intent.setPackage("com.android.phone");intent.setData(Uri.parse("tel:"+number));context.startActivity(intent);现在,在Android5.0Lollipop中,此代码

我有这个代码,在Android 4.4和之前的版本中工作正常:

Intent intent = new Intent(Intent.ACTION_CALL);         intent.setPackage("com.androID.phone");intent.setData(Uri.parse("tel:" + number));context.startActivity(intent);

现在,在AndroID 5.0 Lollipop中,此代码不起作用,并显示此异常:

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

In the documentation,此Intent似乎不被弃用:

任何的想法?提前致谢

解决方法:

好像包名已经改变了

com.androID.phone 

com.androID.server.telecom.

希望这可以帮助!

总结

以上是内存溢出为你收集整理的Android 5中的意图动作调用全部内容,希望文章能够帮你解决Android 5中的意图动作调用所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/1114887.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-29
下一篇2022-05-29

发表评论

登录后才能评论

评论列表(0条)

    保存