开发者

Alarms vs. TIME_TICK in Android

开发者 https://www.devze.com 2022-12-11 00:14 出处:网络
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\'v开发者_Go百科e been using a BroadcastReceiver to check

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'v开发者_Go百科e 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?


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. ;-)

0

精彩评论

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