On Thu, Feb 16, 2012 at 12:28 AM, Weston Weems <[email protected]> wrote:
> I also tried to have in my base callback a context we pass through... > could be activity or app context and thats fine... and say I want to > spawn dialog if context is a subclass of Activity... seems like that > works decent... but seems like that has potential to have problems if > the activity goes away before the callback returns. > Seems like you need to be checking that you're still the active / visible Activity before trying to show anything. If it's the case that you need to show your message from anywhere, at any point, then I would agree with Kris that should just use a notification. Also, are you using showDialog(), managing the Dialogs yourself, or using the new DialogFragments? That might make a difference. I know I always use showDialog() and I have one situation where a dialog is shown delayed based on a network call. If I move to a secondary Activity before it shows, then come back, it's there waiting for me if the first Activity shows it while I was in the second. Perhaps you're managing things yourself and have a bug where you leak the dialogs? On Thu, Feb 16, 2012 at 12:48 AM, Kristopher Micinski < [email protected]> wrote: > (actually, you can probably pop up a toast in your case, which you can do > from the application context..) > OT: You know, this has *never* worked for me - my toasts only show when the Context is an Activity. They don't show from Services or my custom Application class. Wonder what I'm doing wrong ... ------------------------------------------------------------------------------------------------- TreKing <http://sites.google.com/site/rezmobileapps/treking> - Chicago transit tracking app for Android-powered devices -- 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

