Android 中的闹钟与 TIME_TICK
我不确定哪一个适合我当前的应用程序。
我需要在给定但用户可更改的间隔内切换壁纸。我一直在使用 BroadcastReceiver 每分钟检查一次,但后来我看到了这个问题 。
一种方法相对于另一种方法有什么特别的优势吗?现在我必须保持服务处于活动状态才能接收广播,但是使用警报可以避免这种情况吗?
I'm not sure which is these is appropriate for my current application.
I need to switch wallpaper on a given, but user changeable, interval. I've been using a BroadcastReceiver to check every minute, but then I saw this question.
Is there any particular advantage to one method over another? Right now I've got to keep a service alive to receive the broadcast, but would using alarms obviate that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,使用
AlarmManager
意味着您不需要始终将服务保留在内存中。这是一件非常好的事情。 ;-)Yes, using
AlarmManager
would mean you would not need to keep a service in memory all of the time. This is A Very Good Thing. ;-)