tse
tse

Reputation: 6089

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()?

Upvotes: 0

Views: 445

Answers (2)

Jitendra A
Jitendra A

Reputation: 1658

No, it is not possible. Refer the mention in documentation below for onCreate method of Application class.

public void onCreate()

Called when the application is starting, before any activity, service, or receiver objects (excluding content providers) have been created

Upvotes: 0

CommonsWare
CommonsWare

Reputation: 1007399

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.

Is it possible to get Activity.onCreate() or Fragment.onAttached() before Application.onCreate()?

Not in any conventional scenario.

Upvotes: 1

Related Questions