위해이 지금까지알람 관리기 간격 안드로이드
AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
setRepeatingAlarm();
public void setRepeatingAlarm() {
Calendar cal = Calendar.getInstance();
cal.add(Calendar.SECOND, 10);
Intent intent = new Intent(this, TimeAlarm.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(this, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
am.setRepeating(AlarmManager.RTC_WAKEUP, cal.getTimeInMillis(), (15 * 1000), pendingIntent);
}
}
이 내가 달성하기 위해 노력하고 모두가 내가 가지고있는 코드입니다. 선택을 취소하면 다음에 분 30 초 전까지 다시 돌아 오지 않습니다. 따라서 앱을 열면 분당 25 초가 지나면 5 초 후 상태 표시 줄 알림이 활성화됩니다. 하지만 40 초가 지나면 50 초를 더 기다려야합니다. 이 기능을 얻기 위해 캘린더 기능을 사용하는 방법을 잘 모르겠습니다.
감사합니다. 그것은 작동합니다! – anivaler