I want to start a service when my Application is initialized from whatever component.
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
startService(new Intent(getApplicationContext(), MyService.class));
}
}
Is the Service available in the onCreate()
state? Will the super.onCreate()
initialize all components of an Application registered in the AndroidManifest.xml ?
I can run this code in my galaxy s, but I can't make sure it will be run in all devices and platforms, I can't find any documentation about the initialization of an Android APP.