title: AlarmManager set Alarm for Weekly Repeated On Selected Days
body: <p>I am Creating Alarm Application with Setting Alarm of Multiple Days i.e Repeating Alarm.My Android Alarm Application View Like This,<img src="https://i.stack.imgur.com/2C7iR.png" alt="enter image description here">   </p>
  
  <p>i Have Done Code for this,</p>
  
  <pre><code>AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
  Intent alarmIntent = new Intent(ALARM_ACTION_NAME);
  
  alarmIntent.putExtra("AlarmID", m_alarmId);
  
  PendingIntent alarmPI = PendingIntent.getBroadcast(this, m_alarmId, alarmIntent, 0);    
  
  //listofred is a ArrayList of int items.contains int valye for selected days...for My Example listofred:3,4,5,7 
  for (int i = 0; i &lt; listOfred.size(); i++) {
  
                  // for alarm ...
                  calNow = Calendar.getInstance();
                  calSet = (Calendar) calNow.clone();
  
                  int day = calSet.get(Calendar.DAY_OF_WEEK);  //current day...for example.13 dec 2014 - sat  so, day = 7     
  
                  calSet.set(Calendar.DAY_OF_WEEK, listOfred.get(i));
                  calSet.set(Calendar.HOUR_OF_DAY, time_picker.getCurrentHour());
                  calSet.set(Calendar.MINUTE, time_picker.getCurrentMinute());
                  calSet.set(Calendar.SECOND, 0);
                  calSet.set(Calendar.MILLISECOND, 0);
  
  
                  alarmManager.setRepeating(AlarmManager.RTC_WAKEUP,
                          calSet.getTimeInMillis(), (DateUtils.DAY_IN_MILLIS)*7,
                          alarmPI);
  
                  //parameter long intervalMillis.....(DateUtils.DAY_IN_MILLIS)*7 so that it will repeat after each 7 days...
  
  
              }
  </code></pre>
  
  <p>My Problem is When i run this code it will set repeat alarm for only Saturday(<strong>i.e last object in listofred Arraylist</strong>) every time it set alarm for last object in Arraylist.</p>