打盹模式和App待机 [英] Doze mode and App Standby

查看:458
本文介绍了打盹模式和App待机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能知道我的应用程序,如果手机处于打盹模式,或者如果我的应用程序处于待机模式?

How can I know in my app if the phone is in Doze mode or if my app is in Standby mode?

我可以同时通过使用一些订阅的方式知道了吗?

Can I also know it by using some subscribing approach?

推荐答案

您不需要做任何事情来管理待机模式。你只需要管理你的生命周期如常。会有在白天的时候,你的应用程序是要去恢复(这样你就可以同步数据,恢复延迟作业),但通知和警报总会带给你的应用程序出备用。

You don't need to do anything to manage Standby mode. You just need to manage you lifecycle as usual. There will be a time in the day when you app is gonna be resumed (so you can sync data and resume delayed jobs), but notifications and alarms will always bring your app out of standby.

检查了这一点: https://plus.google.com/+ AndroidDevelopers /职位/ 76eh5MaJaXj?LINKID = 18331776

这篇关于打盹模式和App待机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆