I am wondering how one can check that which application is launched in android. For example, when some game is launched or browser is opened, my application gets to know that this very application is launched. Is there anyway to find this thing out?
Asked
Active
Viewed 81 times
1
-
Have You tried this way http://stackoverflow.com/questions/3393908/how-to-get-any-identifier-of-the-topmost-activity and this http://stackoverflow.com/questions/3873659/android-how-can-i-get-the-current-foreground-activity-from-a-service? – sandrstar May 16 '13 at 05:56
1 Answers
0
this code is check service is launched,i think that is very likely with activity
ActivityManager activityManager=(ActivityManager)this.getSystemService(ACTIVITY_SERVICE);
List<RunningServiceInfo> list= activityManager.getRunningServices(70);

minjie
- 79
- 2