I have created a custom compound view by extending FrameLayout
. That view can be on a dialogue box (among others). But what if I want to do some clean-up work when the view disappears from the screen, such as the user's closing the dialogue box? Can I get some kind of onDestroy
event? Or should I make the owner (such as the dialogue box or the fragment) call the view's clean-up method on its (owner's) onDestroy
or dismissed event?
try to use
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With