Android, how to add more than one ContentProvider in Android?

  • Can I use more than one ContentProvider?

  • If possible, how to declare in the manifest? I tried using the following path, but getContentResolver() only gets the first provider.

      <provider android:name=".bean.ItemBean" android:authorities="com.waveletandroid.bean" > </provider> <provider android:name=".bean.CustomerBean" android:authorities="com.waveletandroid.bean" > </provider> 
+4
source share
1 answer

Can I use more than one ContentProvider?

Yes. Or you can have one ContentProvider that provides multiple datasets based on part of the Uri path or using different permissions.

If possible, how to declare in the manifest?

What you have is almost right. However, they cannot have the same power. Change one to the other (e.g. com.waveletandroid.bean2 ).

+6
source

All Articles