Android:java.lang.SecurityException: Permission Denial解决办法
来源:互联网 发布:手机淘宝双色球在哪里 编辑:程序博客网 时间:2024/05/17 06:36
有时程序需要我们创建自己的内容提供器,可能出现java.lang.SecurityException: Permission Denial: opening provider com.example.db.PersonProvider from ProcessRecord错误消息。
这是因为在你的提供外部访问接口的应用程序中没有提供给其他程序访问数据的权限。
解决方法:
在你的provider标签里添加android:exported属性
<provider android:name="com.example.databasetest.DatabaseProvider" android:authorities="com.example.databasetest.provider"android:exported="true" ></provider>
android文档里的内容
android:exported
Whether the content provider is available for other applications to use:
true: The provider is available to other applications. Any application can use the provider’s content URI toaccess it, subject to the permissions specified for the provider.
false: The provider is not available to other applications. Set
android:exported=”false” to limit access to the provider to your
applications. Only applications that have the same user ID (UID) as the provider will have access to it.
The default value is “true” for applications that set either android:minSdkVersion or android:targetSdkVersion to “16” or lower. For applications that set either of these attributes to “17” or higher, the default is “false”.You can set android:exported=”false” and still limit access to your
provider by setting permissions with the permission attribute.
- Android:java.lang.SecurityException: Permission Denial解决办法
- java.lang.SecurityException: Permission Denial:错误解决办法
- java.lang.SecurityException: Permission Denial
- Android java.lang.SecurityException: Permission Denial: requires android.permission.CALL_PRIVILEGED
- ContentProvier使用时:java.lang.SecurityException: Permission Denial:XXX解决办法
- 关于Android抛出java.lang.SecurityException: Permission Denial的错误
- Android拨打电话 java.lang.SecurityException: Permission Denial
- android content provider java.lang.SecurityException: Permission Denial异常解决
- Android 异常- java.lang.SecurityException: Permission Denial:xxx
- 有关Android 6.0权限问题java.lang.SecurityException: Permission Denial
- Android---java.lang.SecurityException: Permission Denial: getTasks() from p
- 《android日常bug系列》java.lang.SecurityException: Permission Denial:
- java.lang.SecurityException: Permission Denial: opening provider
- 错误解决: java.lang.SecurityException: Permission Denial
- java.lang.SecurityException: Permission Denial requires null
- java.lang.SecurityException: Permission Denial: opening provider
- java.lang.SecurityException: Permission Denial: opening provider
- java.lang.SecurityException: Permission Denial: reading
- Opencv定义和输出二维点
- Leetcode: Binary Tree Paths
- LINGO的NLP问题
- iOS学习(2)
- spark core源码分析1 集群启动及任务提交过程
- Android:java.lang.SecurityException: Permission Denial解决办法
- 小谈 Ubuntu 联网
- 暑期留校iOS学习笔记
- 日经社説 20150823 ポストバブル世代の発想生かそう
- Opencv定义和输出三维点
- 暑期留校iOS学习笔记
- 社説 20150823 こうのとり 信頼される日本の宇宙技術に
- Android之使用MediaMetadataRetriever类获取媒体信息
- 10 Easy Ways To Protect Your Eyes From The Harms of Digital Devices