Alarm Manager events not fired (registering for notifications per day)
<p>I am writing an application which needs a homewidget showing the current date. For that I have used the alarm manager registering as follows:-</p>

<pre><code>Intent intent = new Intent(HomeScreenWidgetProvider.ACTION_UPDATE_DATE);
    intent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_IDS, appWidgetId);
    intent.setData(getUriData(appWidgetId));
    PendingIntent datePendingIntent = PendingIntent.getBroadcast(getApplicationContext(), 0, intent,
        PendingIntent.FLAG_UPDATE_CURRENT);

    AlarmManager alarms = (AlarmManager) getApplicationContext().getSystemService(Context.ALARM_SERVICE);
    alarms.cancel(datePendingIntent);
    **alarms.setRepeating(AlarmManager.RTC, getTimeForMidnight(), AlarmManager.INTERVAL_DAY, datePendingIntent);**
</code></pre>

<p>As you see, the above code registers for notifications first for the next 12.00AM with an interval of a day from there on. I update the date in my widget when I get a notification from alarm manager.</p>

<p>There is one big problem though. I don't get the alarm manager events when the date changes (at 12.00AM). And so the date does not change in my home screen widget.</p>

<p>The above code works fine in the emulator but not on the device. I am using Samsung Galaxy S 19000 for (real time) testing.</p>

<p>Is there a problem with use of alarm manager? Or is there an alternate way of receiving date change notifications?</p>
