알람 예제 (AlarmManager Example)
As of API 19, all repeating alarms are inexact. Because this method has been available since API 3, your application can safely call it and be assured that it will get similar behavior on both current and older versions of Android.
공식적으로 API 19에서 모든 반복 알람은 정확하지 않다고 명시하고 있다. 실제로 setRepeating() 메서드를 사용해서 반복 알림을 설정하면 최소주기가 60초라는 것을 알 수 있다. 60초보다 빠른 동작이 필요하다면 다른 방법을 사용해야 한다.
activity_main.xml
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
MainActivity.java
package com.alarmexample.mystoryg.alarmexample; |
executeAlarm.java
package com.alarmexample.mystoryg.alarmexample;
|
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> |
'프로그래밍 > Android' 카테고리의 다른 글
Preference Example (0) | 2017.01.10 |
---|---|
브로드캐스트 리시버 (BroadcastReceiver Example) (0) | 2016.12.20 |
알림 예제(Notification Example) (0) | 2016.12.20 |
Service Example (0) | 2016.12.17 |
명시적 인텐트(Explicit Intent) (0) | 2016.12.16 |
암시적 인텐트(Implicit Intent) (0) | 2016.12.15 |
WebView 줄바꿈 문제 (0) | 2016.02.18 |