Question

I try to access my Application from a ContentProvider but it seems that it is being created after the ContentProvider, or at least it's having its onCreate() called after my provider. Which begs the question: in what order are these things initialized? Is it defined?

Thanks

Was it helpful?

Solution

Which begs the question: in what order are these things initialized? Is it defined?

ContentProviders are initialized before your Application instance is. After that will come whatever it is that is triggering your process to exist (e.g., the code to start one of your activities).

Alas, IIRC, this behavior is not well documented.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top