Saturday, June 19, 2010

[android-developers] Re: Avoid non-static inner classes in an activity?

"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' :-)


On Jun 18, 6:51 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> On Fri, Jun 18, 2010 at 6:43 PM, Nathan <critter...@crittermap.com> wrote:
> > In the short term, I've replaced:
> >    tracker.start("UA-YOUR-ACCOUNT-HERE", this);
> > with
> >    tracker.start("UA-YOUR-ACCOUNT-HERE",
> > this.getApplicationContext());
>
> Have you confirmed that you actually get the analytic data after this
> change? I ask only because the Application object returned by
> getApplicationContext() is a bit brain-dead in terms of being a
> Context. A number of GUI-related things fail outright if you use
> getApplicationContext() instead of an Activity, for example. I'm just
> a bit nervous that you may have fixed the leak but broken your
> analytics collection.
>
> BTW, nice bit of sleuthing!
>
> --
> Mark Murphy
> CommonsWare
> mmur...@commonsware.comhttp://commonsware.com

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate