Reputation: 12504
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?
Upvotes: 8
Views: 2347
Reputation: 825
try to use
@Override
protected void onDetachedFromWindow() {
super.onDetachedFromWindow();
}
Upvotes: 14