ActivityManager actvityManager = (ActivityManager)
this.getSystemService( ACTIVITY_SERVICE );
List
boolean appFound = false;
for(int i = 0; i < procInfos.size(); i++)
{
if(procInfos.get(i).processName == "com.android.camera")
appFound = true;
}
if (appFound)
Toast.makeText(getApplicationContext(), "Camera App is running!!!!", Toast.LENGTH_LONG).show();
else
Toast.makeText(getApplicationContext(), "Camera App is not running!!!!", Toast.LENGTH_LONG).show();
the above snippet shows your camera application is running or not.
replace this line List procInfos = actvityManager.getRunningAppProcesses(); with below line for removing processNamne error in eclipse
ReplyDeleteList procInfos = actvityManager.getRunningAppProcesses();
This comment has been removed by the author.
ReplyDelete