title: Why android.intent.action.TIME_SET calls my BroadcastReceiver onReceive multiple times
body: <p>1) <code>android.intent.action.BOOT_COMPLETED</code> is working fine it calls the broadcast onReceive only once</p>
  
  <p>2) <code>android.intent.action.TIME_SET</code> is calls the broadcast on multiple times  when user manually changes the time it calls the broadcast onReceive multiple times</p>
  
  <p>3) <code>android.intent.action.DATE_CHANGED</code> is working fine when user manually changes the date but along with this action this android.intent.action.TIME_SET is too called so the broadcast onReceive called twice</p>
  
  <p>In my case i want to my cancel existing alarm and set the new alarm but now it calls the onReceive multiple times which results cancel existing alarm and set the new alarm multiple times &amp; am getting multiple notification</p>
  
  <pre><code> &lt;receiver android:name=".MyReceiver" android:enabled="true" android:exported="true"&gt;
  &lt;intent-filter&gt;
      &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
      &lt;action android:name="android.intent.action.DATE_CHANGED" /&gt;
      &lt;action android:name="android.intent.action.TIME_SET" /&gt;
  &lt;/intent-filter&gt;
  &lt;/receiver&gt;
  </code></pre>
  
  <p>MyReceiver.java</p>
  
  <pre><code>public class MyReceiver extends BroadcastReceiver {
  
      private String TAG="MyReceiver";
  
      private static final String ACTION_LOCAL_NOTIFICATION = "com.example.android.alarm.ACTION_LOCAL_NOTIFICATION";
      @Override
      public void onReceive(Context context, Intent intent) {
  
          if(ACTION_LOCAL_NOTIFICATION.equalsIgnoreCase(intent.getAction())) {
  
           Log.d("MyReceiver", "Send Local Notification");
  
          }else  if("android.intent.action.BOOT_COMPLETED".equalsIgnoreCase(intent.getAction()) ||
                  "android.intent.action.TIME_SET".equalsIgnoreCase(intent.getAction()) ||
                  "android.intent.action.DATE_CHANGED".equalsIgnoreCase(intent.getAction()))
          {
  
              Log.d("MyReceiver", "Cancel exhisting Alarm &amp; Set new Alarm ");
  
              DBOperation databaseOperations=new DBOperation(context);
              databaseOperations.openSqliteDB();
              ArrayList&lt;MyAlarmItem&gt; alarmList=databaseOperations.fetchAllAlarm();
              databaseOperations.closeSqliteDB();
              int alarmListSize=alarmList.size();
              AppAlarmManager alarmManager=new AppAlarmManager(context);
              for (int i=0;i&lt;alarmListSize;i++)
              {
                  MyAlarmItem alarmItem=alarmList.get(i);
                  alarmManager.RestoreAlarm(alarmItem);
              }
          }
  
  }
  </code></pre>