I have one app with a ContentProvider:
<provider android:name="ExampleProvider"
android:readPermission="example.contentprovider.READ"
android:label="Example Content Provider"
android:authorities="example.contentprovider.provider"
/>
and another app requests permission to access the provider:
<uses-permission android:name="example.contentprovider.READ" />
But when I run the second app, I get
E/AndroidRuntime( 818): java.lang.RuntimeException: Unable to start activity
ComponentInfo{example.contentresolver/example.contentresolver.ContentResolverActivity}:
java.lang.SecurityException: Permission Denial: reading example.contentprovider.ExampleProvider
uri content://example.contentprovider.provider/words from pid=818, uid=10045
requires example.contentprovider.READ, or grantUriPermission()
Why am I getting this error?
You should define the permission first in the app that creates the ContentProvider, then use it.