Android examples for Android OS:Process
is Running Process by Package
//package com.java2s; import android.app.ActivityManager; import java.util.List; public class Main { public static boolean isRunningProcess(ActivityManager activityManager, String packageName) { boolean isRunning = false; List<ActivityManager.RunningAppProcessInfo> processInfos = activityManager .getRunningAppProcesses(); for (ActivityManager.RunningAppProcessInfo processInfo : processInfos) { if (processInfo.processName.equals(packageName)) { isRunning = true;/*from ww w. jav a 2s . co m*/ break; } } return isRunning; } }