Recently had to fix a bug where we had Toast's being created against activity from Async tasks. Looking at the docs it looks like we should have used ApplicationContext instead of Activties.
I am unaware of any instance where there is more than 1 Application. In what situation during the lifecycle accessible via Android code do I need to treat Application as a not-singleton? More explicitly, Is it safe to treat Application as a singleton? I.E. in fragment.onAttach() grab a local reference the activity.getApplicationContext() and assume that it will ALWAYS return the same object. If Application is a singleton what is the reasoning for making it inaccessible to fragments? -- 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 --- You received this message because you are subscribed to the Google Groups "Android Developers" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

