By

Sometimes it is useful to hook into an Android application’s start-up code i.e. application oncreate e.g. to perform some standard bootstrap type stuff.

This can be done in two steps:

Step 1 – Override the Application Class

public class ExampleApp extends Application {
	  @Override public void onCreate() {
	    super.onCreate();
	    // bootstrap stuff
	  }
}

Step 2 – Update the Manifest

Add a name attribute to the application element in the manifest and give it the name of the class created in step 1



Share