let's say that we've a background service which needs to have the name of the apk file of the foreground application running, How to do that? Is there any other way to do that? not necessarily from a service maybe?
Asked
Active
Viewed 251 times
0
-
What does `foreground running application` mean? I can have many running applications, and more than one in the foreground. Even focus has no meaning since I might be using apps that do not have input method focus. You need to be more explicit about what you are trying to do. – Simon Aug 20 '13 at 19:43
-
The most recently used one maybe?. However, this is not the point. Is it possible to get the apk file name of any application anyway? – Ahmad Aug 20 '13 at 19:49
-
Yes, `PackageManager` – Simon Aug 20 '13 at 19:50
-
can you please explain? just high level explanation would be great! – Ahmad Aug 20 '13 at 19:51
-
1http://stackoverflow.com/questions/2695746/how-to-get-a-list-of-installed-android-applications-and-pick-one-to-run – Simon Aug 20 '13 at 19:52