1.跨项目访问数据库contentprovider使用报错
java.lang.SecurityException: Permission Denial: opening provider com.itcast.db.PersonProvider from ProcessRecord{40f82218 23563:com.example.aapp/u0a10079} (pid=23563, uid=10079) that is not exported from uid 10074
解决:
在AndroidManifest.xml 中给ContentProvider 的定义里面加上个android:exported=”true” 就可以了,同一项目内访问不必加
如:
<provider android:name="com.provider.MyContentProvider"
android:authorities="com.provider.mycontentprovider"
android:exported="true"></provider>