I was wondering is there a way of getting a list with all running activities ?
Asked
Active
Viewed 5,766 times
3
-
i think you ment to ask these http://stackoverflow.com/questions/3304685/how-to-get-the-list-of-running-applications please search – PedroAGSantos Aug 22 '11 at 06:41
-
No, there is no way. See: http://groups.google.com/group/android-developers/browse_thread/thread/57f051efdcfc0c17# – Chakaiko Dec 13 '11 at 19:49
2 Answers
2
As far as I understand there will only one activity running at a time that will be your active activity on screen, other activities will be in paused or Stopped state if any.

Tushar Vengurlekar
- 7,649
- 8
- 33
- 48
-
That's correct Tushar. Reference: http://developer.android.com/images/activity_lifecycle.png – Indrek Kõue Aug 22 '11 at 06:41
-
1
No, as far as I know there is no built in way to get a list of running activities (assuming running - means non-destroyed activities).
If you only need a list of activities in your application, you can create some kind of "registrar" mechanism, so each activity registers in onCreate()
and unregisters in onDestroy()
. This should be some singleton class, because it should automatically be "cleared" if application is killed (as opposed to storing list of active activities in DB).

inazaruk
- 74,247
- 24
- 188
- 156