title: Alarm manager trigger every time app running
body: <p>I want to create a repeating alarm from AlarmManager which is triggered at 21:00 every day to show a notification. So i create a service and declare that in manifest, in the service class i wrote a method for schedule repeating alarms.</p>
  
  <pre><code>public static void setRecurringAlarm(Context context) {
  
      AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
      Intent i = new Intent(context, NotificationService.class);
      PendingIntent pi = PendingIntent.getService(context, 0, i, 0);
      am.cancel(pi);
  
      Calendar updateTime = Calendar.getInstance();
      updateTime.setTimeZone(TimeZone.getDefault());
      updateTime.set(Calendar.HOUR_OF_DAY, 21);
      updateTime.set(Calendar.MINUTE, 00);
      updateTime.set(Calendar.SECOND, 00);
  
      am.setInexactRepeating(AlarmManager.RTC_WAKEUP,
              updateTime.getTimeInMillis(),
              AlarmManager.INTERVAL_FIFTEEN_MINUTES, pi);
  
  }
  </code></pre>
  
  <p>(For test i set the delay INTERVAL_FIFTEEN_MINUTES).</p>
  
  <p>I call this method at onResume() of my splash screen activity and in a BroadcastReceiver that is set up to receive BOOT_COMPLETED.</p>
  
  <pre><code>@Override 
  protected void onResume() {
      super.onResume();
      NotificationService.setRecurringAlarm(this);
  }
  </code></pre>
  
  <p>this is my BroadcastReceicer :</p>
  
  <pre><code>public class NotificationBootReceiver extends BroadcastReceiver {
  
      public void onReceive(Context context, Intent intent) {
          NotificationService.setRecurringAlarm(context);
      }
  
  }
  </code></pre>
  
  <p>and this is my manifest :</p>
  
  <pre><code>    &lt;receiver android:name=".notification.NotificationBootReceiver"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
          &lt;service android:name=".notification.NotificationService" /&gt;
      &lt;/application&gt;
      &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
  </code></pre>
  
  <p>the problem is every time i open the app and splashscreen running the alarm triggered and notification will be shown.</p>