开发者

how to set windowonfocuschange() event in android

开发者 https://www.devze.com 2023-02-28 13:07 出处:网络
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

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

精彩评论

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