title: How to detect if view's parent activity is being destroyed
body: <p>I want to do some cleanup in a view when the activity is being destroyed. Is there any way to get a callback in the View when the activity is being destroyed? I tried using <code>onDetachedFromWindow</code>, but I'm not sure whether it is correct thing to do.</p>