title: How do I make alarmmanager execute after my application has been closed?
body: <p>I want to make my alarmmanager to rings although after my application closed.</p>
  <p>But now my code don`t call broadcastreceiver after my application closed.</p>
  <p>I reg my broadcastreceiver in my manifest.</p>
  <p>This is code that setting alarmmanager</p>
  <pre><code>final AlarmManager alarmManager=(AlarmManager) getSystemService(ALARM_SERVICE);
  Intent intent=new Intent(setTimeActivity.this,autoCheckReceiver.class);
  intent.setAction(&quot;com.dayo.selfcheck.autoCheckReceiver&quot;);
  final PendingIntent pendingIntent=PendingIntent.getBroadcast(setTimeActivity.this,0,intent,PendingIntent.FLAG_UPDATE_CURRENT);
  
  alarmManager.cancel(pendingIntent);
  Calendar calendar = Calendar.getInstance();
  calendar.set(Calendar.HOUR_OF_DAY, timePicker.getHour());
  calendar.set(Calendar.MINUTE, timePicker.getMinute());
  calendar.set(Calendar.SECOND, 0);
  calendar.set(Calendar.MILLISECOND, 0);
  alarmManager.setInexactRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), AlarmManager.INTERVAL_DAY, pendingIntent);
                  
  </code></pre>
  <p>And this code is my broadcastreceiver.</p>
  <pre><code>public class autoCheckReceiver extends BroadcastReceiver {
  
      private String TAG=&quot;autoCR&quot;;
      @Override
      public void onReceive(Context context, Intent it) {
          Log.d(TAG,&quot;asdf&quot;);
          Intent i = new Intent();
          i.setClassName(&quot;com.dayo.selfcheck&quot;, &quot;com.dayo.selfcheck.MainActivity&quot;);
          i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          context.startActivity(i);
      }
  }
  </code></pre>
  <p>this is my manifest file.</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;receiver
              android:name=&quot;.autoCheckReceiver&quot;
              android:exported=&quot;false&quot;&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name=&quot;com.dayo.selfcheck.autoCheckReceiver&quot;&gt;&lt;/action&gt;
              &lt;/intent-filter&gt;
  &lt;/receiver&gt;
  </code></pre>
  <p>thanks!</p>