Hi,
In my application, I have created a ContentProvider. Is there a way for me to instantiate this ContentProvider when my apk is started? RIght now, the ContentProvider only instantiates when someone does a query.
Thank you.
Hi,
In my application, I have created a ContentProvider. Is there a way for me to instantiate this ContentProvider when my apk is started? RIght now, the ContentProvider only instantiates when someone does a query.
Thank you.
What exactly do you mean by 'instantiate' your Content Provider? Generally you should be using a Content Resolver to access Content Providers rather than instantiating them directly.
If you want to initiate a query against your Content Provider when your application is first started, you can extend the Application
class and override the onCreate
method, making a query to your Content Provider from there.
If you go that way, you'll also need to modify the <application>
node in your manifest to include an android:name
attribute that specifies your new Application class implementation.