There is nothing the framework provides -- there is no "the" global
application (you can have multiple applications running in one process), nor
concept of a "current" activity (especially when you mix tabs into the
picture).

Given that you know more about what is really going to happen (and not
happen) in your process, though, you can fairly easily make your own static
and set it as appropriate for retrieval by other code.

On Wed, Sep 2, 2009 at 9:38 PM, sdphil <[email protected]> wrote:

>
> i've asked this before, and wonderful dianne has answered, but i'm not
> satisfied with the answer :) -- dang he's stubborn!
>
> i want to know within a method / code, is there a way to get at the
> global application object or current activity without having an
> activity / context / whatever first.
>
> for example:
>
> public static Object getApp() {
>    // insert code here to get a handle to an android.app.Application
> object.
> }
>
> it just seems there *has* to be a way...
>
> tia.
> >
>


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