On Sat, Jun 19, 2010 at 8:37 PM, Streets Of Boston
<[email protected]> wrote:
> "I ask only because the Application object returned by
> getApplicationContext() is a bit brain-dead in terms of being a
> Context"
>
> Not to hijack the thread, but which things do fail? I assume that the
> call to tracker.start takes a Context as parameter and
> getApplicationContext() is a proper Context. Which methods are
> 'braindead' :-)

Well, as I wrote:

"A number of GUI-related things fail outright if you use
getApplicationContext() instead of an Activity, for example."

Off the top of my head, I can't name any specific methods. Resources
don't map right, IIRC, and you can't use one for opening a Dialog. It
seems like any time I suggest somebody replace getApplicationContext()
with "this" in a StackOverflow answer, it fixes their problem.
Frankly, I just avoid getApplicationContext() completely unless I am
specifically looking for the Application object.

Also, FWIW, Ms. Hackborn has voiced her concerns about Application as
a Context in the past.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Development Wiki: http://wiki.andmob.org

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