[英]Can the app get Fragment.onAttached() before Application.onCreate()?
Is there any dependency between Application's and Activity's/Fragment's lifecycle? 应用程序和活动/片段的生命周期之间是否有任何依存关系? Is it possible to get
Activity.onCreate()
or Fragment.onAttached()
before Application.onCreate()
? 是否可以在
Application.onCreate()
之前获取Activity.onCreate()
或Fragment.onAttached()
Application.onCreate()
?
Is there any dependency between Application's and Activity's/Fragment's lifecycle?
应用程序和活动/片段的生命周期之间是否有任何依存关系?
The Application
singleton for your process will be created before any activities, let alone fragments. 您的流程的
Application
单例将在任何活动之前创建,更不用说片段了。
Is it possible to get Activity.onCreate() or Fragment.onAttached() before Application.onCreate()?
是否可以在Application.onCreate()之前获取Activity.onCreate()或Fragment.onAttached()?
Not in any conventional scenario. 在任何常规情况下都没有。
No, it is not possible. 不,不可能。 Refer the mention in documentation below for onCreate method of Application class.
请参阅以下文档中有关Application类的onCreate方法的提及。
public void onCreate()
公共无效onCreate()
Called when the application is starting, before any activity, service, or receiver objects (excluding content providers) have been created
在应用程序启动时,创建任何活动,服务或接收者对象(内容提供者除外)之前调用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.