hi,

take NotifyWithText api demo as example.

add in the begging of onCreate System.gc() and some logs with
getInstanceCount() and try to show any Toast, then exit NotifyWithText
demo. run it again - you will see getInstanceCount() increases leaking
Activities. repeat running demo couple of times. counter still
increases.

now change context passed to Toast.makeText() by
adding .getApplicationContext() - now getInstanceCount() always shows
5.

so beware with Toasts - always use app ctx

thanks
pskink
--~--~---------~--~----~------------~-------~--~----~
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