본문 바로가기

개인공부/안드로이드

alarm깨달은것

getBaseContext

getApplicationContext

등의 차이점.



alarmManagr의 Time이


현재시간을 기준으로 울리기시간전까지의 값(카운트다운?) 인건지

울릴 시간인건지.. 거참


후자였어.


아래써있듯이, 내가하려는 방법으로는 System.currentTimeMillis값에 더해줘야겠군.



AlarmManager.ELAPSED_REALTIME_WAKEUP type is used to trigger the alarm since boot time


alarmManager.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, 600000, pendingIntent);

will actually make the alarm go off 10 min after the device boots.


There is a timer that starts running when the device boots up to measure the uptime of the device and this is the type that triggers your alarm according to the uptime of the device.


Whereas, AlarmManager.RTC_WAKEUP will trigger the alarm according to the time of the clock. For example if you can do


int thirtySecondsFromNow = System.currentTimeMillis() + 30 * 1000;

alarmManager.set(AlarmManager.RTC_WAKEUP, thirtySecondsFromNow , pendingIntent);

this on the other hand will trigger the alarm 30 seconds from now.


AlarmManager.ELAPSED_REALTIME_WAKEUP type is rarely used compared to AlarmManager.RTC_WAKEUP..


'개인공부 > 안드로이드' 카테고리의 다른 글

android alarmmanager.setRepeating  (0) 2014.01.03
안드로이드 alarm  (0) 2014.01.03
android timepickerfragment  (0) 2014.01.03
android %02d  (0) 2014.01.03
android final  (0) 2014.01.03