Java tutorial
//package com.java2s; import android.app.ActivityManager; import android.content.Context; import java.util.List; public class Main { public static int getRunningProcess(Context context) { ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE); List<ActivityManager.RunningAppProcessInfo> lists = am.getRunningAppProcesses(); return lists.size(); } }