android is there any view callback when it's destroyed?
问题 I have a custom view component. I used it in either fragment or activity. I would like to know if there's a callback when it's destroyed from fragment/activity? 回答1: View does not have a callback (except finalize() , but I don't think that's what you're asking for). View has onDetachedFromWindow() when it is removed from the screen, but this is not related to it being destroyed -- it could be attached again, which will call onAttachedToWindow() . Fragment has onDestroyView() , which may be