Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
529 views
in Technique[技术] by (71.8m points)

android - Why does ContentProvider.onCreate() get called before Application.onCreate()?

I registered a ContentProvider in AndroidManifest.xml, and the ContentProvider.onCreate() was called even before the Application.onCreate(). I don't understand this behavior, in my opinion, It's more natural that Application.onCreate() be called before any of the components in the application. Could someone tell me the timing of Application.onCreate() and other components' onCreate() gets called?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

According a Google's issue it's how this should work (although documentation is wrong).

There's another question that have a workarround that can help you.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...