Android - Application onCreate method - does it ALWAYS get called first? -


i preparing new version of 1 of apps, , made such huge changes in app, need data conversion after update of app absolutely first thing (before doing else). figured out, best place in class (which extends application) in oncreate() method. tested few times, , seems work ok, read documentation:

base class need maintain global application state. can provide own implementation specifying name in androidmanifest.xml's tag, [b]which cause class instantiated when process application/package created[/b].

it looks right, not quite sure. can confirm/disprove it?

the application constructor called first. application::oncreate() method called. exception know of if application contains contentprovider, can receive calls before application does.

this here: http://developer.android.com/reference/android/app/application.html#oncreate()

public void oncreate ()

added in api level 1 called when application starting, before activity, service, or receiver objects (excluding content providers) have been created. implementations should quick possible (for example using lazy initialization of state) since time spent in function directly impacts performance of starting first activity, service, or receiver in process. if override method, sure call super.oncreate().


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -