I had something sort of working once, but it kept doing things like reporting an ime as the foreground, rather than the activity it was accepting input on behalf of... which made it useless for my purpose.
On Aug 22, 4:29 pm, Dianne Hackborn <[email protected]> wrote: > Note that these methods are very much not intended for doing anything except > presenting UI to the user about what is running. Do not rely on them to > drive logic in your app. You will ultimately be unhappy. > > > > > > On Sat, Aug 21, 2010 at 11:35 PM, Pent <[email protected]> wrote: > > > Does anyone know how to, or if it's even possible to check the > > > (foreground process/top of the activity stack) from a service? > > > It is possible, see the ActivityManager class functions like > > getRunningAppProcesses(). > > getRunningTasks() looks useful but is flakey in my experience e.g. > > when you > > return to the launcher it is sometimes not updated. > > > Pent > > > -- > > You received this message because you are subscribed to the Google > > Groups "Android Developers" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected]<android-developers%2Bunsubs > > [email protected]> > > For more options, visit this group at > >http://groups.google.com/group/android-developers?hl=en > > -- > Dianne Hackborn > Android framework engineer > [email protected] > > Note: please don't send private questions to me, as I don't have time to > provide private support, and so won't reply to such e-mails. All such > questions should be posted on public forums, where I and others can see and > answer them. -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

