Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Content Provider instances and DB synchronization

When we access content provider from multiple content resolvers (in different process) or thread, does it create multiple instances of provider? If yes, how are instances created and how are DB read-write operations synchronized?

like image 293
user1653781 Avatar asked Dec 04 '25 23:12

user1653781


1 Answers

By default there is only one instance of a Content Provider and it is hosted in the process hosting the application to which the Content Provider belongs. It is possible to configure it in such a way that a separate instance of Content Provider is created in every process that uses that Content Provider. This configuration is done in the AndroidManifest.xml of the application to which the Content Provider belongs. Refer to this

like image 133
Sameer Avatar answered Dec 07 '25 17:12

Sameer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!