On Mar 26, 1:24 pm, TreKing <treking...@gmail.com> wrote:
> On Sat, Mar 26, 2011 at 2:32 PM, Archit Jain <dce.arc...@gmail.com> wrote:
> > Dialog alertDialog = new Dialog(getApplicationContext());
>
> Never use getApplicationContext() - it's pointless and doesn't work for
> Dialogs. I'm surprised you're seeing anything.

It's not pointless, and please stop telling people that.  :-)

You just have to know when to use it.  Use it when you need to store a
context in an object that lives longer than an instance of an activity
or service, but don't want to leak that activity or service.  The
application context is perfect for that.

Doug

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

Reply via email to