title: Alarm manager set alarm on a day of week
body: <p>I have a time picker dialog where i am picking the time for the alarm. I am then setting what day i want the alarm to go off. If i specify today(saturday) "for day of week" the alarm goes off on the correct time specified on the time picker. If I set lets say monday the alarm goes off instantly as soon as i set it. </p>
  
  <p>How, can i schedule an alarm to go off on a certain day of the week thats not today? </p>
  
  <p><strong>JAVA</strong></p>
  
  <pre><code>timepickerdialog = new TimePickerDialog(AddAlarmActivity.this,
                          new TimePickerDialog.OnTimeSetListener() {
  
                              @Override
                              public void onTimeSet(TimePicker view, int hourOfDay,
                                                    int minute) {
  
                                  Calendar ca = Calendar.getInstance();
                                  ca.set(Calendar.HOUR_OF_DAY,hourOfDay);
                                  ca.set(Calendar.MINUTE,minute);
                                  ca.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
                                  ca.set(Calendar.SECOND, 0);
                                  ca.set(Calendar.MILLISECOND, 0);
  
                                  AlarmManager alarmManager;
                                  alarmManager = (AlarmManager) AddAlarmActivity.this.getSystemService(ALARM_SERVICE);
                                  Intent intent;
  
                                  intent = new Intent(AddAlarmActivity.this, AlarmReceiver.class);
                                  pendingIntent = PendingIntent.getBroadcast(AddAlarmActivity.this, 0, intent, 0);
                                  alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, ca.getTimeInMillis(), 1000*60*60*24, pendingIntent);
  </code></pre>
  
  <p>It appears that if i set the day thats today or none at all it works great. Why wont it work for a day thats not the current day and how can i get it to work? I am turning to SO because im not getting any help with google.</p>
  
  <p>I have also tried ca.set(Calendar.DAY_OF_WEEK, 2);</p>
  
  <p>Thank you</p>