마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

부팅 시 알람이 초기화되는 문제.

0 추천

알람 매니저 관련 질문합니다.

Intent intent = new Intent(AlarmTest.this, AlarmedTimeShow.class);
				intent.putExtra("time", hh+":"+mm);
				intent.putExtra("data", "알람: " + currentCalendar.getTime().toLocaleString());
				
				
				Toast.makeText(mContext, "reqCode : "+reqCode, 0).show();
			
				PendingIntent[] pendingIntent = new PendingIntent[5];
				
				for (int j = 0; j < pendingIntent.length; j++) {
					//0, 1, 2, 3, 4
					pendingIntent[j] = PendingIntent.getActivity(AlarmTest.this, j, intent, PendingIntent.FLAG_UPDATE_CURRENT);
					intent.putExtra("reqCode", j);
					Log.d("reqCode", "reqCode is... " + j);
					
				}
for (int j = 0; j <= 4; j++) {
					
					alarmManager.set(AlarmManager.RTC_WAKEUP, gregorianCalendar.getTimeInMillis() + (1000 * j), pendingIntent[j]);//0
					System.out.println("for문을 이용한 알람 등록 완료!");
				}

이런식으로 알람을 등록한 후에 AlarmedTimedShow 클래스에서 액티비티가 실행되게 해놓았습니다.

부팅 시에 알람이 초기화되는데요. 이같은 경우 어떻게 해야할까요?

익명사용자 님이 2013년 10월 26일 질문

1개의 답변

0 추천
부팅시에 날라오는 Intent 를 등록하여 해당 Intent를 받았을 때 알람을 다시 등록해줘야합니다.
dingpong (5,180 포인트) 님이 2013년 10월 26일 답변
...