1

I found only broadcast event for date change "android.intent.action.DATE_CHANGED" But It is only working when user manually change the date.

Please suggest some default broadcast for the problem.

My other alternatives to achieve that can be : But m ignoring these things

  • Alarm - to be triggered at exact 12:00 am for all days.(But need to take care all time zones

  • My own repeating task : That will keep on checking if current date has changed from previous saved one.

Would appreciate any solution for the same from some official sources.

Arpit Garg
  • 8,476
  • 6
  • 34
  • 59

1 Answers1

2

Yes android.intent.action.DATE_CHANGED action has been raised when user changes the date. I think you are trying to set an alarm for daily (that you are handling Date change action). But this is not a solution. You need to set daily alarms. Like

alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,
    calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent);

To do repeating task there are some ways, read more at Scheduling recurring task in Android

Community
  • 1
  • 1
Pankaj Kumar
  • 81,967
  • 29
  • 167
  • 186
  • Thanks for your suggestion. But as I mentioned I would like to ignore using Alarm.These are my last options to achieve that. – Arpit Garg May 02 '14 at 12:58
  • @ArpitGarg http://stackoverflow.com/questions/14376470/scheduling-recurring-task-in-android Read it – Pankaj Kumar May 02 '14 at 13:07