title: Set Repeating Alarm Every Day at Specific time In Android
body: <p>I am using Alarm manager to run alarm at specific time every day. Below is the code</p>
  
  <pre><code> Calendar calendar = Calendar.getInstance();
      calendar.setTimeInMillis(System.currentTimeMillis());
      calendar.set(Calendar.HOUR_OF_DAY, 00);
      calendar.set(Calendar.MINUTE, 00);
  
        AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
          Intent intent = new Intent(this, OnAlarmReceive.class);
          PendingIntent pendingIntent =PendingIntent.getBroadcast(this.getApplicationContext(), 0, intent,PendingIntent.FLAG_UPDATE_CURRENT);
          alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
                  24*60*60*1000, pendingIntent);
  </code></pre>
  
  <p>I am Setting alarm at 12AM every day. And Below is the code for BroadCastReciever</p>
  
  <pre><code>@Override
     public void onReceive(Context context, Intent intent)
     {
             System.out.println("Time is 12 Am");
             Toast.makeText(context, "Alarm Triggered", Toast.LENGTH_LONG).show();     
      }
  </code></pre>
  
  <p>Problem in this code is Alarm is Triggered As soon as i Run the Application Irrespective of time. Any help will be Appreciated. Thank You</p>