title: AlarmManager is not triggered when App is closed
body: <p>I have some in-App notification to show to users at a specific time but nothing is shown when the App is closed.</p>
  
  <p>Setting alarm:</p>
  
  <pre><code>Intent alarmIntent = new Intent(mMotherActivity, ReminderAlarmManager.class);
  
  if (ReminderNotificationType.CHANGE_LENS.equals(notificationType)) {
      alarmIntent.putExtra("NOTIFICATION_TYPE", "REMINDER");
  } else {
      alarmIntent.putExtra("NOTIFICATION_TYPE", "ORDER");
  }
  
  long scTime = alarmDate.getTime();
  PendingIntent pendingIntent = PendingIntent.getBroadcast(mMotherActivity, 0, alarmIntent, 0);
  AlarmManager alarmManager = (AlarmManager) mMotherActivity.getSystemService(mMotherActivity.ALARM_SERVICE);
  alarmManager.set(AlarmManager.RTC_WAKEUP, scTime, pendingIntent);
  </code></pre>
  
  <p>broadcast receiver:</p>
  
  <pre><code>public class ReminderAlarmManager extends BroadcastReceiver {
  
      @Override
      public void onReceive(Context context, Intent intent) {
  
          String notificationType = intent.getStringExtra("NOTIFICATION_TYPE");
          if(notificationType.equalsIgnoreCase("ORDER"))
          {
              Intent i = new Intent(context, OrderReminderNotificationService.class);
              context.startService(i);
          }
          else if(notificationType.equalsIgnoreCase("REMINDER"))
          {
              Intent i = new Intent(context, ReminderNotificationService.class);
              context.startService(i);
          }
      }
  }
  </code></pre>
  
  <p>So when it comes to scTime, even if the App is closed, I would like to trigger a notification. So I'm calling a service by the PendingIntent, as follows:</p>
  
  <pre><code>public class OrderReminderNotificationService extends IntentService {
  
      public OrderReminderNotificationService(String name) {
          super(name);
      }
  
      @Override
      protected void onHandleIntent(Intent intent) {
  
          String ns = Context.NOTIFICATION_SERVICE;
          NotificationManager mNotificationManager = (NotificationManager) getSystemService(ns);
  
          Context context = getApplicationContext();
          NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
              context);
  
          Uri uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
          mBuilder.setContentTitle("Notification");
          mBuilder.setContentText(context.getString(R.string.renewOrderNotificationMsg));
          mBuilder.setSmallIcon(R.mipmap.ic_launcher);
          mBuilder.setSound(uri);
          mBuilder.setAutoCancel(true);
  
          Intent notificationIntent = new Intent(this, LoginActivity.class);
          PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0);
          mBuilder.setContentIntent(contentIntent);
          mNotificationManager.notify(2, mBuilder.build());
  }
  </code></pre>
  
  <p>The part in the manifest concerning that:</p>
  
  <pre><code>&lt;receiver android:name="com.company.utils.ReminderAlarmManager"&gt;
      &lt;intent-filter&gt;
          &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;
      &lt;/intent-filter&gt;
  &lt;/receiver&gt;
  </code></pre>
  
  <p>But nothing shows up... What am I doing wrong ? </p>