I want to update my running service so I can for example, when the current day of the week is "Monday", it do a notification in a certain time that it's "Monday", and when it's "Tuesday" it do a notification that it's "Tuesday" and so on... The problem is, how to make my running service be refreshed or updated so that it can receive the updated day from the calender everyday? What I should use? TimerTask package (How)?, or make a Thread or what? and please if there is an example or a logic code for solving something like this it will be great if you posted it here... Thanks.
相关问题
- 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?
Add a
Broadcast receiver
to your service, set an alarm usingAlarmManager
for that certain time for Monday, so that when the alarm goes off it starts the broadcast receiver of your service and inside the receiver you can set the alarm for the next day.To add broadcast receiver to service see this