get Process Count - Android Android OS

Android examples for Android OS:Process

Description

get Process Count

Demo Code


//package com.java2s;

import android.app.ActivityManager;

import android.content.Context;

public class Main {

    public static int getProcessCount(Context context) {
        ActivityManager am = (ActivityManager) context
                .getSystemService(Context.ACTIVITY_SERVICE);
        return am.getRunningAppProcesses().size();
    }//from   w  w w .j  a  v  a 2  s  . c om
}

Related Tutorials