Is the Application instance always created before any Activities?

主宰稳场 提交于 2020-01-02 02:02:49

问题


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?


回答1:


will this implementation always be created before the initial Activity

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




回答2:


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.



来源:https://stackoverflow.com/questions/14881002/is-the-application-instance-always-created-before-any-activities

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!