Application Register Activity Lifecycle Callbacks - Android Activity

Android examples for Activity:Activity Action

Description

Application Register Activity Lifecycle Callbacks

Demo Code


//package com.java2s;

import android.annotation.TargetApi;
import android.app.Application;
import android.app.Application.ActivityLifecycleCallbacks;

import android.os.Build;

public class Main {
    @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
    public static void ApplicationRegisterActivityLifecycleCallbacks(
            Application application, ActivityLifecycleCallbacks callbacks) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
            application.registerActivityLifecycleCallbacks(callbacks);
        }//from  w  w  w  . j  ava2  s  . c o m
    }
}

Related Tutorials