how to set windowonfocuschange() event in android
<p>i have an image view whose image should keep on changing every 5 seconds when the window in which it is drawn has focus. when the window loses focus then the thread that was changing the image should close.</p>

<p>for the above to happen i need to implement the onwindowfocuschange(boolean haswindowfocus) method, but i don't know how to implement the same</p>

<p>thank you in advance.</p>
