Java tutorial
//package com.java2s; //License from project: Open Source License import android.os.AsyncTask; import java.io.IOException; public class Main { public static void killPackage(final String packageToKill) { new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { try { Runtime.getRuntime().exec(new String[] { "su", "-c", "pkill " + packageToKill }); } catch (IOException e) { e.printStackTrace(); } return null; } }.execute(); } }