"I can't depend on onPause/onStop/onDestroy to dismiss them." Why not?
Just add a method to your own TextView class that allows communication between the activity and the text-view. Best would be to show/dismiss this dialog in the Activity and have your TextView call your Activity's methods (e.g. showDialog/ hideDialog) that then will show or dismiss this dialog. If you 'modify' (override?) your TextView, you can add an instance member to it that points to your activity to accomplish this task. On Oct 2, 9:50 am, Vijay S <vijay.meenakshisunda...@gmail.com> wrote: > I'm modifying TextView.java. I can't depend on onPause/onStop/onDestroy to > dismiss them. Is there an alternative to what you suggested? > > > > On Fri, Oct 2, 2009 at 8:36 AM, Mark Murphy <mmur...@commonsware.com> wrote: > > > > Ok. I wanted to destroy them before orientation changes. As I create > > > them from textview, what is the best way to dismiss them without > > > leaking. The view does n't know the orientation change, if I'm not > > > wrong. > > > Move that logic out of the the View and into the Activity. Then, dismiss > > them in whichever of onPause/onStop/onDestroy fits your needs best. Save a > > flag or something in onSaveInstanceState() to let you know to re-open them > > after the orientation change. > > > -- > > Mark Murphy (a Commons Guy) > >http://commonsware.com > > Android App Developer Books:http://commonsware.com/books.html- Hide quoted > > text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---