title: Alarm Manager and Pending Intent Cancel Not Working
body: <p><strong>I schedule Alarm from Activity like.</strong></p>
  
  <pre><code>   private AlarmManager mAlarmManager;  
              mAlarmManager = (AlarmManager) ACT_ActiveSession.getAppContext()
                      .getSystemService(Context.ALARM_SERVICE);
              Intent intent = new Intent(mContext, LocalNotification.class);
              intent.putExtra("alertBody", "");
              intent.putExtra(K.SESSIONID, "");
              intent.putExtra("TIME", "");
              intent.putExtra("BATCHNO","");
              intent.putExtra("REQUEST_CODE", "");
              PendingIntent pendingIntent = PendingIntent.getBroadcast(
                      ACT_ActiveSession.getAppContext(), REQUEST_CODE, intent, 0);
              mAlarmManager.setExact(AlarmManager.RTC_WAKEUP, finishTime,
                      pendingIntent);
              // alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, finishTime,
              // (1 * 1000), pendingIntent);
  </code></pre>
  
  <p><code>intent.putExtra("","");</code> only used for some task on <code>BroadcastReceiver</code></p>
  
  <p><strong>And Cancel Alarm From   Fragment</strong> </p>
  
  <pre><code>private AlarmManager mAlarmManager; 
  
      mAlarmManager = (AlarmManager) mActivity
                              .getSystemService(Context.ALARM_SERVICE);
                      Intent updateServiceIntent = new Intent(mActivity,
                              ACT_Home.class);
  
                      PendingIntent pendingUpdateIntent = PendingIntent.getBroadcast(
                              mActivity, REQUEST_CODE,
                              updateServiceIntent, 0);
                       pendingUpdateIntent.cancel();
                      // Cancel alarms
                      if (pendingUpdateIntent != null) {
                          mAlarmManager.cancel(pendingUpdateIntent);
                          Log.e("", "alaram canceled ");
                      } else {
                          Log.e("", "pendingUpdateIntent is null");
                      }
  </code></pre>
  
  <p>But Alarm Manager is not cancelled.
  Here i change <code>mActivity</code> = <code>MyActivity</code>'s static <code>getApplicationContext();</code> and also change different Flags and different Context.</p>
  
  <p>Also I refer many answer. <strong>But doesn't work any code.</strong> <a href="http://itquestionz.com/questions/4586489/android-alarmmanager-cancel-from-another-activity" rel="nofollow noreferrer">Link1</a> <a href="https://stackoverflow.com/questions/17615986/how-to-stop-an-alarm-in-android/17616299#17616299">Link2</a> <a href="https://stackoverflow.com/questions/14106299/change-the-intent-of-pendingintent-which-is-used-by-an-alarmmanager/14244012#14244012">Link3</a></p>
  
  <p>please give me solution as soon as possible.
  and apologize for my bad English.</p>