title: Alarm not called on Android
body: <p>So I am trying to implement the repeating feature from this site - <a href="http://www.java2s.com/Code/Android/Core-Class/Exampleofschedulingoneshotandrepeatingalarms.htm" rel="nofollow">http://www.java2s.com/Code/Android/Core-Class/Exampleofschedulingoneshotandrepeatingalarms.htm</a> - into my Android app but it's not calling the class for some reason here is the code excerpts.</p>
  
  <pre><code>public class MainActivity extends Activity implements SensorEventListener {
  
  // Schedule repeating alarm
  
            Intent intent = new Intent(MainActivity.this, RepeatingAlarm.class);
            PendingIntent sender = PendingIntent.getBroadcast(MainActivity.this, 0,
                intent, 0);
  
            // We want the alarm to go off 30 seconds from now.
            long firstTime = SystemClock.elapsedRealtime();
            firstTime += 15 * 1000;
  
            // Schedule the alarm!
            AlarmManager am = (AlarmManager) getSystemService(ALARM_SERVICE);
            am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, firstTime,
                15 * 1000, sender);
  
            // Tell the user about what we did.
              Toast.makeText(
                      getApplicationContext(),
                      "Scheduled", Toast.LENGTH_LONG)
                      .show();
  
  }
  
  //Schedule alarm for data upload
  class RepeatingAlarm extends BroadcastReceiver {
        @Override
        public void onReceive(Context context, Intent intent) {
              Toast.makeText(
                      context,
                      "ALARMED!", Toast.LENGTH_LONG)
                      .show();
        }
  }
  </code></pre>
  
  <p>If it helps the full code is here: <a href="https://gist.github.com/4410665" rel="nofollow">https://gist.github.com/4410665</a></p>