Frage

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

War es hilfreich?

Lösung

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.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top