Reputation: 3690
I'm seeing 200ms or more latency between MyApplication#onCreate
and MyActivity#onCreate
. Does anything significant happen in that interval?
Upvotes: 3
Views: 181
Reputation: 351
Application onCreate() : Called only once when application start. if you kill app then open app. it will call again.
Activity onCreate() : Called then the activity is created. it you re-open activity it will call again but Application onCreate will call only once within application.
Upvotes: 0
Reputation:
Called before the first components of the application starts
Called then the activity is created. Used to initialize the activity, for example create the user interface.
Upvotes: 0
Reputation: 106
Based on the documentation of Application#onCreate
(link), it is called before any Activity/Service/Receiver objects are created.
This means that after Application#onCreate
the Activity (MyActivity in your case) is instantiated and only then can Activity#onCreate
be called.
EDIT: Based on your implementation, even the call to super.onCreate()
in MyActivity would add to the time interval.
Upvotes: 1