Hello i have created an android app that uses a custom content provider named CustomCP, it implements all methods and everything works fine while managing data inside the app, but when i try to access it from another app i keep getting an error of " Failed to find provider info for com.example.customcp.
I have declared my content provider in the manifest file of the first app as
<provider android:name="com.example.CustomCP" android:authorities="com.example.customcp"/>
I try to call the provider in the second's application start up activity
public class app2 extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Uri kUri = Uri.parse("content://com.example.customcp/key");
Cursor c = managedQuery(kUri, null, null, null, null);
}
}
So the question is simple , is it possible to access a custom content provider from multiple applications?
ContentResolver
to access theContentProvider
of another application. You need to useContentResolver
instead of themanagedQuery
– CloselippedContentProvider
you need to declare that in the manifest file ofthat application. did you do that? – Closelipped