exit Application - Android android.app

Android examples for android.app:ActivityManager

Description

exit Application

Demo Code

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());
  }//from ww w.  j  av  a2  s.  co m

}

Related Tutorials