[android-developers] Re: activity leaked a window

2009-10-02 Thread Dianne Hackborn
onDetachedFromWindow() will be called before the text view is removed from its window. I can't recall exactly the sequence from destroy, but this should before we look for leaked windows. I am pretty sure that other widgets that use pop-up and dialog windows use this to remove them. On Fri, Oct

[android-developers] Re: activity leaked a window

2009-10-02 Thread Mark Murphy
> "Best would be to show/dismiss this dialog in the Activity" > > I can't write code inside Activty's methods like onPause/onStop/onDestroy > because the applications will not be mine always. They can be 3rd party > apps. Create methods on your homebrew TextView implementation that Activity needs

[android-developers] Re: activity leaked a window

2009-10-02 Thread Streets Of Boston
Are you coding to the SDK or modifying the platform? You could modify the TextView by adding a method that accepts a reference to any Activity. Then, in your TextView, use that activity-reference to handle pop-up dialogs. On Oct 2, 10:07 am, Vijay S wrote: > "Best would be to show/dismiss this

[android-developers] Re: activity leaked a window

2009-10-02 Thread Vijay S
"Best would be to show/dismiss this dialog in the Activity" I can't write code inside Activty's methods like onPause/onStop/onDestroy because the applications will not be mine always. They can be 3rd party apps. I need a good place from where I can call popupwindow.dissmiss() when the orientation

[android-developers] Re: activity leaked a window

2009-10-02 Thread Streets Of Boston
"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

[android-developers] Re: activity leaked a window

2009-10-02 Thread Vijay S
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 wrote: > > > Ok. I wanted to destroy them before orientation changes. As I create > > them from textview, what is th

[android-developers] Re: activity leaked a window

2009-10-02 Thread Mark Murphy
> 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

[android-developers] Re: activity leaked a window

2009-10-02 Thread Vijay
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. On Oct 1, 2009, at 11:28 PM, Romain Guy wrote: > > If you create the popup window

[android-developers] Re: activity leaked a window

2009-10-01 Thread Romain Guy
If you create the popup windows you are responsible for managing them on orientation change. That bug is yours :) On Thu, Oct 1, 2009 at 9:20 PM, Vijay wrote: > > Is the 'Activity leaked window' issue (http://code.google.com/p/ > beepmystuff/issues/detail?id=3) fixed in any of the latest Android

[android-developers] Re: activity leaked a window

2009-10-01 Thread Vijay
http://code.google.com/p/beepmystuff/issues/detail?id=3 is the link for the bug. Thanks. On Oct 1, 11:20 pm, Vijay wrote: > Is the 'Activity leaked window' issue (http://code.google.com/p/ > beepmystuff/issues/detail?id=3) fixed in any of the latest Android > releases? I'm not sure about the An