That begs the question, what is "the messaging app"?

Generally I can't think of much that you can do robustly based on knowing
"what" is currently running in the foreground, since except for your own app
actually finger out what that "what" is can't be very robust.

For figuring out if your own app's activities are running in the foreground,
you can just have a gobal variable that you set that the service checks.

On Mon, Aug 17, 2009 at 5:10 PM, Don Tran <[email protected]> wrote:

>
> Wouldn't that only retrieve the current activity of my own process?
>
> I want a background service to determine at the given time what's the
> current package / activity is running.  So if the user is on the
> messaging app and my service is running in the background, the call
> will return the messaging app.  Not that my service will always be
> running but this information will help my service do additional things
> I want it to do.
>
> On Aug 17, 8:55 am, "Balwinder Kaur (T-Mobile USA)" <balwinder.k...@t-
> mobile.com> wrote:
> > LocalActivityManager would be the class to look into Specifically,
> > getCurrentActivity () will return the current activity.
> >
> >
> http://developer.android.com/reference/android/app/LocalActivityManag...()<http://developer.android.com/reference/android/app/LocalActivityManag...%28%29>
> >
> > Balwinder Kaur
> > Open Source Development Center
> > ·T· · ·Mobile· stick together
> >
> > The views, opinions and statements in this email are those of the
> > author solely in their individual capacity, and do not necessarily
> > represent those of T-Mobile USA, Inc.
> >
> > On Aug 16, 6:49 pm, Don Tran <[email protected]> wrote:
> >
> >
> >
> > > I want my background service to determine the active package or
> > > activity running.  Is this possible?
> >
>


-- 
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to