title: How to set alarm to first Thursday of each month using AlarmManager
body: <p>I am trying to make an alarm notification every first Thursday of each month.</p>
  
  <pre><code> am.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(),AlarmManager.INTERVAL_DAY*30, sender);
  </code></pre>
  
  <p>I cant use the above code since not all months have 30 days in them, is there a way to accomplish this?</p>
  
  <p>Does this indicate the first Thursday of each month?</p>
  
  <pre><code>cal.set(Calendar.DAY_OF_WEEK, 5); // Thursday
  cal.set(Calendar.DAY_OF_WEEK_IN_MONTH, 1); // Thursday
  </code></pre>
  
  <p>Thanks</p>
  
  <p>EDIT</p>
  
  <pre><code>private void createThursayScheduledNotification() {
          Calendar calendar3 = Calendar.getInstance();
          calendar3.set(Calendar.DAY_OF_WEEK, 5); // Thursday
          calendar3.set(Calendar.DAY_OF_WEEK_IN_MONTH, 1); // First Thursday of
                                                              // Each Month
          // Thursday
          calendar3.set(Calendar.HOUR_OF_DAY, 9);
          calendar3.set(Calendar.MINUTE, 0);
          calendar3.set(Calendar.SECOND, 0);
          calendar3.set(Calendar.AM_PM, Calendar.AM);
          AlarmManager alarmMgr = (AlarmManager) getSystemService(ALARM_SERVICE);
          alarmMgr.set(AlarmManager.RTC_WAKEUP,
                  calendar3.getTimeInMillis(), pendingIntent3); // every first Thursday
          createThursayScheduledNotification();
  
      }
  </code></pre>