how to set windowonfocuschange() event in android
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.
for the above to happen i need to implement the onwindowfocuschange(boolean haswindowfocus) method, but开发者_StackOverflow社区 i don't know how to implement the same
thank you in advance.
you can use ViewFlipper and in onPause() method you may call stopFlipping() which will stop that. onPause is called when your activity loses focus
精彩评论