开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜