Is the Application instance always created before

2019-04-24 14:51发布

In Android, you can provide your own implementation of the Application class by extending it and declaring the name in the Manifest.

My question is, will this implementation always be created before the initial Activity, or can Activities be launched before the Application instance has had time to be created?

2条回答
欢心
2楼-- · 2019-04-24 14:55

will this implementation always be created before the initial Activity

Yes. It is one of the first objects instantiated in your process.

查看更多
时光不老,我们不散
3楼-- · 2019-04-24 15:20

Yes Application class is the first class which is inititated in any android application...

And thus if any class extends the application class that class will be initiated first.

查看更多
登录 后发表回答