title: play alert song every 5 minutes even when app is closed
body: <p>I tried to show a toast every 5 minutes and play a alert song, but it is not working, nothing happens.</p>
  
  <p>manifest:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/&gt;
  
  ..
  
  &lt;receiver android:name=".AlarmReceiver"
              android:enabled="false"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.BOOT_COMPLETED"&gt;&lt;/action&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
  </code></pre>
  
  <p>MainActivity:</p>
  
  <pre><code>alarmMgr = (AlarmManager)MainActivity.this.getSystemService(Context.ALARM_SERVICE);
          Intent intent = new Intent(MainActivity.this, AlarmReceiver.class);
          alarmIntent = PendingIntent.getBroadcast(MainActivity.this, 0, intent, 0);
  
  // Set the alarm to start at 8:30 a.m.
          Calendar calendar = Calendar.getInstance();
          calendar.setTimeInMillis(System.currentTimeMillis());
          calendar.set(Calendar.HOUR_OF_DAY, 8);
          calendar.set(Calendar.MINUTE, 30);
  
  // setRepeating() lets you specify a precise custom interval--in this case,
  // 5 minutes.
          alarmMgr.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(),
                  1000 * 60 * 5, alarmIntent);
  </code></pre>
  
  <p>AlarmReceiver:</p>
  
  <pre><code>public class AlarmReceiver extends BroadcastReceiver {
  
      @Override
      public void onReceive(Context context, Intent intent) {
          // TODO Auto-generated method stub
  
          Toast.makeText(context, "OnReceive alarm test", Toast.LENGTH_SHORT).show();
      }
  }
  </code></pre>
  
  <p>any ideas if something is missing or if something is wrong?</p>