exit Application - Android App

Android examples for App:App Running

Description

exit Application

Demo Code


//package com.java2s;

import android.app.ActivityManager;
import android.content.Context;

public class Main {
    @SuppressWarnings("deprecation")
    public static void exitApplication(Context context) {
        ActivityManager am = (ActivityManager) context
                .getSystemService(Context.ACTIVITY_SERVICE);
        am.restartPackage(context.getPackageName());
    }// ww  w.  j ava  2 s . c  o  m
}

Related Tutorials