2011-08-30 3 views
2

내 응용 프로그램에서 다음 코드를 두 번 호출합니다. 한 개의 알람이 이미 실행 중이고 코드가 다시 호출되거나 한 번에 하나만 실행되는 경우 안드로이드는 두 번째 알람을 시작합니까?AlarmManager는 동일한 알람의 인스턴스 두 개를 동시에 실행합니까?

Intent recurringIntent = new Intent(MY_INTENT); 
recurringIntent.setPackage(MY_PACKAGE_NAME); 
PendingIntent recurPendingIntent = PendingIntent.getBroadcast(context, 0 /* requestCode */, recurringIntent, 0 /* flags */); 
AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE); 
am.setRepeating(AlarmManager.ELAPSED_REALTIME, SystemClock.elapsedRealtime(), STATS_TIME_INTERVAL, recurPendingIntent); 

답변

5

동일한 의도와 요청 코드를 사용하여 PendingIntent를 만드는 경우 이전 알람이 덮어 쓰기됩니다.

관련 문제