Hekki wrote:
> Since I'm not sure I fully understand that Context leak thing, I just
> try to avoid it alltogether :
> http://www.curious-creature.org/2008/12/18/avoid-memory-leaks-on-android/

Just be careful where and how you hold onto a Context.

> But to the point :
> I'm trying to make my code as reusable as possible so the class is not
> an inner class, just an anonymous outer class if you will.

Reuse is a design consideration, but only *a* design consideration.
Possible Context leaks are another design consideration.

> It seems like a huge thing to pass the whole context just to have
> access to the connectivity manager and do such a simple task.

Try looking at the source code to the connectivity subsystem someday,
and then try telling me it is "simple".

> Isn't there something like class.parent.getContext or simply a way to
> get access to those crucial components without having a context ?

No.

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

_Android Programming Tutorials_ Version 1.0 In Print!

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