目录

java.lang.SecurityException-Permission-Denial-starting-Intent-actandroid.intent.action.CALL

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL

问题:

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:xxx cmp=com.android.server.telecom/.components.UserCallActivity } from ProcessRecord{eda3bb 29215:com.example.app02_activity/u0a158} (pid=29215, uid=10158) with revoked permission android.permission.CALL_PHONE

原因:

APP需要添加打电话权限、在手机或模拟器中开启该APP的打电话权限。

解决:

1)在 AndroidManifest.xml 中添加打电话权限

<uses-permission android:name="android.permission.CALL_PHONE" />

2)打开APP程序信息

https://i-blog.csdnimg.cn/blog_migrate/5ab3fd4ffa59347a5606ca95d3507974.png

3)将APP的打电话权限设置为允许

https://i-blog.csdnimg.cn/blog_migrate/aeb2a4fea3b6333a000743e5b75cb547.png

https://i-blog.csdnimg.cn/blog_migrate/f59cbd3475727cfe0dc5ed794f140f26.png