Java tutorial
//package com.java2s; import java.io.IOException; import android.view.KeyEvent; public class Main { public static void shutdownActivity() { Runtime runtime = Runtime.getRuntime(); try { runtime.exec("input keyevent " + KeyEvent.KEYCODE_BACK); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } }