我通过以下方式启动闹钟:
protected void onHandleIntent(Intent intent) {
Log.v("alarm", "onHandleIntent");
int alarmType = AlarmManager.ELAPSED_REALTIME_WAKEUP;
long interval = AlarmManager.INTERVAL_HALF_HOUR;
long timeToRefresh = SystemClock.elapsedRealtime() + interval;
alarmManager.setInexactRepeating(alarmType, timeToRefresh, interval, alarmIntent);
updateService();
}
但是警报不是每 30 分钟触发一次,而是每 45 分钟触发一次。为什么?setInexactRepeating 的容差是 15 分钟吗?