나는 처음 알람을 울리면 다시 꺼내려고 노력하는 이유에 대해 혼란 스럽다. 하지만 제 3의 시간은 작동하고 5 번, 7 번, 9 번 등등 ... 그래서 2 번마다 알람이 작동합니다. 내가 철저하게 혼란 스러워요. 왜냐하면 내가 보류 의도를 uniqID에 부여했기 때문이죠. 그래서 이것은 일어나지 않았을 것입니다.여러 개의 알람을 작성하면 알람 관리자가이를 재정의합니까?
setAlarm.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
AlarmManager alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE);
myCal.set(Calendar.YEAR, datePicker.getYear());
myCal.set(Calendar.MONTH, datePicker.getMonth());
myCal.set(Calendar.DAY_OF_MONTH, datePicker.getDayOfMonth());
myCal.set(Calendar.HOUR, timePicker.getCurrentHour());
myCal.set(Calendar.MINUTE, timePicker.getCurrentMinute());
myCal.set(Calendar.SECOND, 0);
//precaution if the user restarts their phone. Saves the alarm to a file
//and when user restarts their phone register a broadcast receiver to pick up
//the broadcast and then re-create the alarms that were stored.
setAlarms(datePicker.getYear(), datePicker.getMonth(), datePicker.getDayOfMonth()
, timePicker.getCurrentHour(), timePicker.getCurrentMinute(), assignmentName);
Intent triggered = new Intent(ManageAlarms.this, alarms.DisplayNotification.class);
triggered.putExtra("NotificationId", 1);
triggered.putExtra("assignmentName", assignmentName);
PendingIntent displayIntent = PendingIntent.getActivity(
ManageAlarms.this, counter, triggered, PendingIntent.FLAG_ONE_SHOT);
/*boolean alarmActive = (PendingIntent.getActivity(getBaseContext(), 0,
triggered, PendingIntent.FLAG_NO_CREATE) != null);
if (alarmActive) {
alarmManager.cancel(displayIntent);
}*/
alarmManager.set(AlarmManager.RTC_WAKEUP,
myCal.getTimeInMillis(), displayIntent);
counter++;
어떻게 알람을 설정하고 의도는 무엇입니까? 다음 알람을 마지막 알람에 가깝게 설정할 수 있습니까? 예를 들어, Alarm은 8 시간마다 실행 된 다음 8 초가 지나면 1 초에 닫히고, 그 다음 알람은 정지 후 바로 다음 초로 설정됩니다. – Opiatefuchs
'adb shell dumpsys alarm'을 사용하여 이벤트가 예정되어 있다고 생각되는 시간에 예약되고 있음을 확인하십시오. – CommonsWare
궁극적으로 사용자가 원하는만큼의 알람을 설정할 수 있기를 바랍니다. 앱의 기능 중 하나는 누군가가 수업에서 배정 할 수있는 알람을 설정할 수 있다는 것입니다. 그리고 나는 그것이 내가 경보를 얼마나 가깝게 설정했는지와 관련이 없다고 생각한다. 지금 알람을 설정하고 5 분 정도 기다렸다가 다음 시간을 설정하면 아무런 차이가 없으며 울리지 않습니다. 그 후 하나는 것입니다. 감사합니다 CommonsWare, 나는 그것을 조사하고 나의 경보가 예정된 것을 본다 ... 그러나 그것은 단지 다른 모든 경보가 해고당하는 이유에 관해서 나에게 어떤 설명도주지 않는다. ... – cj1098