Java tutorial
//package com.java2s; //License from project: Apache License import java.util.List; import android.app.ActivityManager; import android.app.ActivityManager.RunningAppProcessInfo; import android.content.Context; public class Main { public static boolean isRunningProcess(Context context, String packageName) { ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); List<RunningAppProcessInfo> list = manager.getRunningAppProcesses(); for (RunningAppProcessInfo procInfo : list) { if (procInfo.processName.equals(packageName)) return true; } return false; } }