Hi, I am trying to query custom content provider(App A) from another 
app(App B). 

I can do that when there is no permission protection for content provider. 
Specifically, I build custom content provider on App A and sent an intent 
containing the URI to App B. Then App B get the URI and query the data from 
content provider.

Then, I add these permissions to the provider:
        <provider 
android:authorities="com.ck.contentprovider.MyContentProvider"
            android:name="com.ck.contentprovider.MyContentProvider" 
            android:readPermission="android.permission.permRead"
            android:writePermission="android.permission.permWrite"
            android:grantUriPermissions="true">
        </provider>
And add this sentence to the intent so as to grant temporary access to App B
sendIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to