Possible Duplicate:
Listen to ActivityManager events?
Is it possible to know immediately (not by listing / iterating over processes in the background service with intervals) which app (and which activity) has been pushed to the front, perhaps using some kind of broadcast information? I want to know globally which app has been pushed to the front, not just for activities within my app.
It doesn’t look like it’s possible, at least not without modifying the Android source. Take a look at the source of
ApplicationsProvider.This is a similar question: Listen to ActivityManager events?