I am very new to Android. I am working on application that must get the information about the applications currently running on foreground.
It means if user launches any applications, my application should capture the launched application information, by the time my application shouldn’t interrupt launched application.
Example: If user launches browser application my application should print browser application information on log.
How can I do this?
ActivityManagerhas methodgetRunningTasks(int).ActivityManagerseems to be the solution you are searching for.Also, have a look at following thread:
See Android recent task executed by the user