title: Android Alarm Manager Set Repeating every six month at Specific Date
body: <p>I want to repeat my task on every six month. I have the following code also I have another problem with this code, i want start alarm from 9/3/2018 but alarm started from 9/4/2018</p>
  
  <pre><code>import java.util.Calendar;
  import android.app.Activity;
  import android.app.AlarmManager;
  import android.app.PendingIntent;
  import android.content.Context;
  import android.content.Intent;
  import android.os.Bundle;
  
  
  public class MainActivity extends Activity {
  
  
  
      private AlarmManager AlarmManager;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
  
          AlarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
          Intent intent = new Intent(this, AlarmReceiver.class);
          PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
          Calendar calendar = Calendar.getInstance();
          calendar.setTimeInMillis(System.currentTimeMillis());
          calendar.set(Calendar.YEAR, 2018);
          calendar.set(Calendar.MONTH, 3);
          calendar.set(Calendar.DAY_OF_MONTH, 9);
  
          AlarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),7 * 24 * 60 * 60 * 1000, pendingIntent);
  
      }
  }
  </code></pre>