import android.app.*; import android.content.*; import android.os.SystemClock; static void androidEnableRepeatingAlarm(int firstDelayMS, int repeatingDelayMS, S alarmSnippetID) ctex { Activity context = androidActivity(); AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); Class receiverClass = Class.forName("de.tinybrain.javax_allperms.AlarmManagerReceiver"); Intent intent = new Intent(context, receiverClass); intent.putExtra("snippetID", str(parseSnippetID(alarmSnippetID))); PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent, 0); //am.setRepeating(AlarmManager.RTC_WAKEUP, System.currentTimeMillis()+firstDelayMS, repeatingDelayMS, pi); am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime()+firstDelayMS, repeatingDelayMS, pi); }