안녕 난 여기에 알람을하고 난 예 또는 일주일 동안 매일 같은 시간 후에이를 취소 할 수있는 방법을 원하는 ,,, 사전에 감사 ,,일정 기간 후에 어떻게 경보를 취소 할 수 있습니까? | 안드로이드
am = (AlarmManager)parent.getContext().getSystemService(Context.ALARM_SERVICE);
//the title and the description of the notification
Intent alarmintent = new Intent(parent.getContext(), Alarm_Receiver.class);
alarmintent.putExtra("title",titlePills + dea22);
alarmintent.putExtra("note",dea22);
alarmintent.putExtra("NOTIFICATION_ID",String.valueOf(CountMultipleAlarm));
//HELLO_ID is a static variable that must be initialized at the BEGINNING OF CLASS with 1;
//example:protected static int HELLO_ID =1;
PendingIntent sender = PendingIntent.getBroadcast(parent.getContext(), CountMultipleAlarm,
alarmintent,0);
//VERY IMPORTANT TO SET FLAG_UPDATE_CURRENT... this will send correct extra's informations to
//AlarmReceiver Class
// Get the AlarmManager service
am.setRepeating(AlarmManager.RTC_WAKEUP,cal.getTimeInMillis(), 11000, sender);
intentArray.add(sender);
원래 알람을 취소하는 것이 다른 알람을 설정합니까? – PearsonArtPhoto
코드가 있으십니까? 나는 시간주기와 취소 기능을 어떻게 해야할지 모르겠다 –
내 대답은 당신이 취소 알람 수신기에 넣어해야 코드를 보여줍니다. 이미 알람을 설정 했으니 잠깐 설정할 수 있다고 가정 할 것입니다. 거기에 포함 된 코드를 플로팅하십시오 (이미 약간의 여분 비트가 필요합니다). 가기. – PearsonArtPhoto