Reputation: 37
I am writing my first alarm program. The program sets a repeating alarm, which is expected to trigger every 200mseconds. But the point is, instead of that, the interval is almost 40 seconds!! And it seems that whatever interval time I set it doesn't really matter. So in reality it seems that after API 19 there is no way to make setRepeating()
kind of an alarm to trigger more often, than ~40 seconds, right?
Here is a snippet of the code:
if(alarmRepetition.equalsIgnoreCase(context.getString(R.string.alarm_once))){
Intent backIntent = new Intent("Time to delete an Alarm kva-kva");
backIntent.putExtra("Time to delete", alarmId);
Calendar calendarNow = Calendar.getInstance();
PendingIntent pendingIntent = PendingIntent.getBroadcast(context, alarmId, backIntent, 0);
AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
alarmManager.setRepeating(AlarmManager.RTC, calendarNow.getTimeInMillis(), 200, pendingIntent);
}
Upvotes: 0
Views: 117