android application subclass
// Create a subclass of Application
// Application.onCreate() will be invoked when the app starts
public class ExampleApplication extends android.app.Application {
public void onCreate() {
super.onCreate();
Log.i("ExampleApplication", "Application Started");
}
}
// Register the Application subclass in the manifest
// Get application object in other app components:
ExampleApplication app = (ExampleApplication) getApplication();
|