I am using the following snippet to check whether applications that I finish()
ed are indeed no longer running:
ActivityManager am = (ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
List<ActivityManager.RunningAppProcessInfo> procList = am.getRunningAppProcesses();
for (ActivityManager.RunningAppProcessInfo proc : procList)
Log.d(TAG, proc.processName);
}
To my dismay, some applications that I finish()
ed (in their Activity.onCreate(), even before they had a chance to launch anything), are still listed there.
Why?
LogCat shows that these applications' onDestroy()
was definitely called.
What does it take to truly remove an application from that list?
Is killProcess()
my only recourse?