AlarmManager firing off when not needed
<p>I want AlarmManager to fire every day at 12 o'clock.</p>

<pre><code>public void alarm()
{

    AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
    Intent intent = new Intent(this, TimeNotification.class);
    PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0,
    intent, PendingIntent.FLAG_CANCEL_CURRENT );

    am.cancel(pendingIntent);

    if ( preferences.getBoolean("showNoti", true) )
    {

    Calendar cal = Calendar.getInstance();

    cal.setTimeInMillis(System.currentTimeMillis());
    cal.set(Calendar.HOUR_OF_DAY, 12);
    cal.set(Calendar.MINUTE, 0);
    cal.set(Calendar.SECOND, 0);
    cal.set(Calendar.MILLISECOND, 0);

    am.set(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), pendingIntent);  
    am.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent);

    }

}  
</code></pre>

<p>Yet it also fires every time this method is called. Any ideas what I'm doing wrong?</p>

<p>Thanks!</p>
