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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -