Answer the question
In order to leave comments, you need to log in
Why does the AlarmManager after restarting the service execute for the first time after 30 seconds?
alarmManager = (AlarmManager) gcontext.getSystemService(gcontext.ALARM_SERVICE);
alarmManager.setRepeating(
AlarmManager.ELAPSED_REALTIME_WAKEUP,
System.currentTimeMillis(),
SystemClock.elapsedRealtime() + DB.getServiceRepeatTime(),
pendingIntent);
Answer the question
In order to leave comments, you need to log in
What is the sdk version? Carefully read the java doc for AlarmManager - the fact is that starting from version > 19 - there is no guarantee that the AlarmManager will work exactly at the time you specified.
" Note: as of API 19, all repeating alarms are inexact. If your
* application needs precise delivery times then it must use one-time
* exact alarms, rescheduling each time as described above."
This is from the javadoc
I hope I understood the question correctly
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question