Domanda

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

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top