这是一个问题贴,但是我的积分不够分不够发帖啦  ̄□ ̄||
答案
自定义权限:
<permission
android:name="DeclarPermissionDangerous"
android:description="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:protectionLevel="dangerous" />
后来确定问题在于 android:name="permissionName"
经测试 permissionName 如果定义为 反向域风格reverse-domain-style
(com.tom.permission) 即可正常使用。
Google 官方文档的意思是建议使用“反向域风格”,但是如果不使用会造成错误,这也是试验过才知道的。
问题
我写了两个应用测试权限相关的功能细节
应用a 声明(创造)权限并用来保护自己的 Activity应用b 声明(使用)权限并且调用应用 a 的 activity
应用 a 代码
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="tom.work.foxmail.com.declarpermission">
<permission
android:name="DeclarPermissionNormal"
android:description="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:protectionLevel="normal" />
<permission
android:name="DeclarPermissionDangerous"
android:description="@strin