AlarmManager scheduling
<p>I'm  trying to schedule my alarm manager to fire up an intent every hour in a day. 
this is what I do , and it doesnt work properly.</p>

<p>code:</p>

<pre><code> new code after edit:


          Calendar cal = Calendar.getInstance();
    cal.set(Calendar.HOUR_OF_DAY , 22); //22:00 of every evening
    cal.set(Calendar.MINUTE , 0); //initiate minute time
    cal.set(Calendar.SECOND , 0);
    cal.add(Calendar.MINUTE, randomMinutes); //adding mintues so we get random time btw 22:00-07:00
    cal.add(Calendar.DAY_OF_YEAR, 1); //switching to the next day.



    am.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(),
            AlarmManager.INTERVAL_DAY, pi);
</code></pre>

<p>randomMinutesis some number from 0 to 600</p>

<p>thanks,</p>

<p>ray.</p>
