title: Android AlarmManager triggering alarm immediately
body: <p>I want to schedule an alarm 15 min before a certain fixed time. But my alarm is triggered as soon as it is set and not when it should trigger. The time set is not in the past. I verified the alarmTime by converting it to date and it is correct. Also my <code>BroadcastReceiver</code> is registered correctly (in <code>AndroidManifest.xml</code>).</p>
  
  <p>Any suggestions ?</p>
  
  <p>Here is my code below : </p>
  
  <pre><code>setAlarm(long fixedTime){
  
      final int beforeTime = 15*60; // 15 min before
      final Long alarmTime = (fixedTime - beforeTime)*1000L;
      final AlarmManager am = (AlarmManager)   context.getSystemService(Context.ALARM_SERVICE);
      am.set(AlarmManager.RTC_WAKEUP, alarmTime, getIntent());
  }
  
  
  private PendingIntent getIntent(){
  
      final Intent intent = new Intent(context, MyReceiver.class);
      final PendingIntent pi = PendingIntent.getBroadcast(context, 22714, intent, PendingIntent.FLAG_CANCEL_CURRENT);
      return pi;
  }
  </code></pre>