本文介绍了setAndAllowWhileIdle和setExactAndAllowWhileIdle之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
AlarmManager.setAndAllowWhileIdle()
和AlarmManager.setExactAndAllowWhileIdle()
有什么区别?这些都如何影响Android 6.0(棉花糖)API中引入的打ze模式?
What is difference between AlarmManager.setAndAllowWhileIdle()
and AlarmManager.setExactAndAllowWhileIdle()
? How does these both affect Doze mode introduced in Android 6.0 (Marshmallow) API?
推荐答案
请参阅AlarmManager
的文档:
实际上,您提到的两个方法都指定它们的行为类似于没有"AndAllowWhileIdle"(set
和setExact
)的对应方法.因此,其中一个将在准确的时间发出警报,而另一个将不准确.
Indeed, both the methods you mentioned specify that they behave like their counterparts without the "AndAllowWhileIdle" (set
and setExact
). So one of them will deliver the alarm at the exact time and the other will not be exact.
这篇关于setAndAllowWhileIdle和setExactAndAllowWhileIdle之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!