I am looking for some Intent which get broadcasted every second. I looked into android.intent.action.TIME_TICK
but this intent get broadcasted every minute. I know AlarmManger/handler/thread can be used for this purpose, but I am inclined to use system broadcasted intent.
Please share your thoughts?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
This isn't possible. There is no broadcast intent sent every second.
I've posted a full list of broadcast intents here (it's found in the
platforms/android-xx/data/broadcast_actions.txt
, and none of them cover per-second actions. This is further confirmed in the documentation (searching "second" on the page produces nothing in this context).You will have to pick one of
AlarmManager
,Handler
,Thread
,Timer
, or something else in this vein. Some of this topic is covered here, more here, some stuff on a timer here, et cetera...I do not think so. First because if system would send a broadcast every second it would drain the battery. Second, if many apps were interested in handling the broadcast, that could seriously slow down the system.
Update
There is in fact a Intent fired once a minute, but there is restriction on how you can use it
http://developer.android.com/reference/android/content/Intent.html#ACTION_TIME_TICK