My understanding is that you should use getApplicationContext when possible. Using "this" as the context introduces the possibility of accidentally hanging on to a reference to your entire activity, thus creating a memory leak. As for getBaseContext(), I believe you use that when you create a context wrapper, to get the context that's being wrapped. I could be wrong about that though... never used it.
~c On Tue, Mar 1, 2011 at 11:17 AM, dashman <erjdri...@gmail.com> wrote: > What are the differences between any of these calls - > all called from within my Activity sub-class instance. > > getApplicationContext() > > getBaseContext() > > this > > I need to get the context primarily for prefs for my apps - there > are multiple Activities but i'd like to reference the same > common prefs for my app. > > > -- > 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+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en -- 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en