알람 시계를 만들경우
알람을 0~4개까지 할려고하는데.
setalarm을 다음과 같이 할 경우 하였습니다.
Intent intent = new Intent(ServiceClass.this,MainActivity.class);
intent.putExtra("splash_check", "true");
PendingIntent sender = PendingIntent.getActivity(mContext, afternoonAlarmId, intent, PendingIntent.FLAG_CANCEL_CURRENT);
mManager = (AlarmManager)getSystemService(ALARM_SERVICE);
calendar.set(Calendar.HOUR_OF_DAY, 9);
calendar.set(Calendar.MINUTE, 40);
calendar.set(Calendar.SECOND, 0);
mManager = (AlarmManager)getSystemService(ALARM_SERVICE);
//알람 시간
mManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), 0, sender);
Toast.makeText(ServiceClass.this, "알람 설정 시간 " + calendar.getTime().toString(), Toast.LENGTH_LONG).show();
이런식으로 하면 9시40분0초에 한번 activity를 띄우고 toast를 띄우겠죠
그렇다면
알람 1,2,3,4 각각 다 set을 할경우 각각의 알람을 set하는 함수를 따로 만들어서 해야하나요?
알람을 해지할려면 각각해야하나요?
afternoonAlarmId을 다 따로 주어서 각각 set하고 cancel해야하나요?