开发者

Android detect when the application is paused

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜