开发者

Android detect when the application is paused

开发者 https://www.devze.com 2023-03-18 08:30 出处:网络
I\'m implementin开发者_如何学编程g an application witch need to run a task periodically, but its only needed if the application is in foreground.

I'm implementin开发者_如何学编程g an application witch need to run a task periodically, but its only needed if the application is in foreground. So i'd like to remove the periodic handler callbacks on application pause and resume on restart. There is any easy way of doing that? Thanks in advance


Call removeCallbacks() in onPause() and vice versa in onResume().

0

精彩评论

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

关注公众号