title: alarmManager getting stopped when app is completely closed
body: <p>I have a counter that needs to be reset at midnight every day  as well as some notification that needs to be displayed whether the app is closed or not.
  For that I have an alarmManager that is set up:</p>
  
  <pre><code>    public void scheduleAlarm()
  {
      Calendar calendar = Calendar.getInstance();
      calendar.setTimeInMillis(System.currentTimeMillis());
      calendar.add(Calendar.DAY_OF_YEAR, 0);
      calendar.set(Calendar.HOUR_OF_DAY, 0);
      calendar.set(Calendar.MINUTE, 01);
      Intent intentAlarm = new Intent(this, AlarmReceiver.class);
      AlarmManager alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
      alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY,
                                PendingIntent.getBroadcast(getApplicationContext(), 1, intentAlarm,
                                                           PendingIntent.FLAG_UPDATE_CURRENT));
  }
  </code></pre>
  
  <p>It is registered in the android manifest as follow: </p>
  
  <pre><code>        &lt;receiver android:name="com.whitepebblesplus.AlarmReceiver"&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN"/&gt;
          &lt;/intent-filter&gt;
      &lt;/receiver&gt;
  </code></pre>
  
  <p>and I have in the alarmReceiver class the following</p>
  
  <pre><code>public class AlarmReceiver extends BroadcastReceiver {
  
  @Override
  public void onReceive(Context context, Intent intent) 
  </code></pre>
  
  <p>My problem is that whenever the app is closed the alarm won't go off and so the counter won't be reseted, not until the app starts again, which is really not what I want.</p>
  
  <p>Anyone of you has an idea on how to make the alarm goes off whether the app is running or not?</p>
  
  <p>thanks</p>