Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

android application class

// 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

<manifest 
  xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.app">

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

// Get application object in other app components:

ExampleApplication app = (ExampleApplication) getApplication();
Comment

PREVIOUS NEXT
Code Example
Java :: how to make a loop in java 
Java :: how to remove null values in java 
Java :: formula to calculate area of a triangle java 
Java :: java convert date to localdate 
Java :: javafx start 
Java :: primitive data types in java 
Java :: load a list from text file java 
Java :: java stack methods 
Java :: runtime intalize array in java 
Java :: java delete column from csv 
Java :: java get length of a string 
Java :: synchronized java 
Java :: pointers in java 
Java :: java long to double 
Java :: declare class constant array java 
Java :: blurview android github 
Java :: how to operate on values from different classes in java 
Java :: java print formatted string 
Java :: final in java 
Java :: java iterate hashmap 
Java :: what is packages in java 
Java :: Java char data type 
Java :: how to use user uid in android 
Java :: java fot 
Java :: get string from int java 
Java :: get last string separated by / 
Java :: android get last crash adb 
Java :: java clear string buffer 
Java :: fixed length array powershell PSv5+ 
Java :: java convert am pm to 24 hour 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =