0

Thanks for previous replies,

Is it possible to know which are the applications running in background process.My query is to get the list of applications which is running in background. I searched this for a while, but still dint get any proper solution. pls guide me.

RAAAAM
  • 3,378
  • 19
  • 59
  • 108

1 Answers1

0

You can get a list of services running using this sort of code:

private boolean isMyServiceRunning(Context context)
{
    ActivityManager manager = (ActivityManager) context.getSystemService(Service.ACTIVITY_SERVICE);
    for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE))
    {           
        if (service.service.getClassName().equals("myPackage.MySuperApplication"))
        {               
            return true;
        }
    }
    return false;
}

There are a whole bunch of Service. types that you can check for and if you want to find a specific one, you use its fully qualified name.

John J Smith
  • 11,435
  • 9
  • 53
  • 72