Answers for "android application"

2

android application

import android.app.Application;

public class MyApplication extends Application {
    // Called when the application is starting;
    // before any activity, service, or receiver objects have been created.
	@Override
	public void onCreate() {
	    super.onCreate();
        // your code here
	}
}

in the AndroidManifest.xml:

<application 
    android:name=".MyApplication"
    ...>

get application object in other parts of the code:

MyApplication app = (MyApplication) getApplication();
Posted by: Guest on March-08-2021

Code answers related to "android application"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language