I need to check every 15 minutes a feed RSS file in order to update my application's results; I know I have to implement a service, but I was wondering which approach I should use to do this; is it better to implement a timer (http://developerlife.com/tutorials/?p=356) or a thread inside the service (http://www.youtube.com/watch?v=yfWsp9IHX1Y)? I tried the first tutorial but I get the error "Can’t create handler inside thread that has not called Looper prepare in Android"... What should I do? Stay stick with the first method or try the other one?
相关问题
- 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
You should use a PendingIntent and register it with the AlarmManager to be started 15 minutes in the future. This way your app won't use any ressources until the alarm fires.
You need to use the Intent that starts your Service to create the PendingIntent. After your service finished you need to reregister the PendingIntent for the next execution of your service.