다음을 통해 공유


AlarmManager.SetAndAllowWhileIdle(AlarmType, Int64, PendingIntent) 메서드

정의

마찬가지로 #set(int, long, PendingIntent), 시스템이 저전력 유휴 상태인 경우에도 이 알람을 실행할 수 있습니다(a.

[Android.Runtime.Register("setAndAllowWhileIdle", "(IJLandroid/app/PendingIntent;)V", "GetSetAndAllowWhileIdle_IJLandroid_app_PendingIntent_Handler", ApiSince=23)]
public virtual void SetAndAllowWhileIdle (Android.App.AlarmType type, long triggerAtMillis, Android.App.PendingIntent operation);
[<Android.Runtime.Register("setAndAllowWhileIdle", "(IJLandroid/app/PendingIntent;)V", "GetSetAndAllowWhileIdle_IJLandroid_app_PendingIntent_Handler", ApiSince=23)>]
abstract member SetAndAllowWhileIdle : Android.App.AlarmType * int64 * Android.App.PendingIntent -> unit
override this.SetAndAllowWhileIdle : Android.App.AlarmType * int64 * Android.App.PendingIntent -> unit

매개 변수

type
AlarmType

경보 유형입니다.

triggerAtMillis
Int64

알람 유형에 따라 적절한 클록을 사용하여 알람이 꺼져야 하는 시간(밀리초)입니다.

operation
PendingIntent

알람이 꺼지면 수행할 작업입니다. 은 일반적으로 .에서 PendingIntent#getBroadcast IntentSender.getBroadcast()제공됩니다.

특성

설명

마찬가지로 #set(int, long, PendingIntent)이 경보는 시스템이 저전력 유휴 모드(즉, doze) 모드인 경우에도 실행할 수 있습니다. 이 유형의 알람은 유휴 상태일 때 알람이 꺼져야 하는 상황에 b only/b>를< 사용해야 합니다<>. 이는 사용자가 인식할 수 있도록 소리를 내야 하는 일정 알림에 대한 합리적인 예입니다. 알람이 디스패치되면 약 10초 동안 시스템의 임시 전원 예외 목록에 앱이 추가되어 해당 애플리케이션이 작업을 완료할 수 있는 추가 절전 모드 해제 잠금을 획득할 수 있습니다.</p>

이러한 경보는 유휴 상태일 때 디바이스의 전원 사용에 큰 영향을 줄 수 있으므로 앱 예약 시 배터리가 크게 저하되므로 주의해서 사용해야 합니다. 남용을 줄이기 위해 특정 애플리케이션에 대해 이러한 경보가 얼마나 자주 꺼지는지에 대한 제한이 있습니다. 정상적인 시스템 작업에서는 이러한 알람을 약 1분 이상 디스패치하지 않습니다(이 시점에서 보류 중인 모든 알람이 디스패치됨). 저전력 유휴 모드에서는 15분과 같이 이 기간이 훨씬 길어질 수 있습니다.

다른 경보와 달리, 시스템은 다른 경보, 심지어 같은 응용 프로그램에서 그 순서대로 발생하는 경보의이 유형을 다시 예약 할 수 있습니다. 이는 디바이스가 유휴 상태일 때(유휴 상태에서 이 알람이 꺼질 수 있고, 앱의 다른 알람이 나중까지 유지될 때) 분명히 발생하지만 유휴 상태가 아닌 경우에도 발생할 수 있습니다.

앱의 대상 SDK 버전에 관계없이 이 호출은 항상 알람 일괄 처리를 허용합니다.

에 대한 android.app.AlarmManager.setAndAllowWhileIdle(int, long, android.app.PendingIntent)Java 설명서

이 페이지의 일부는 Android 오픈 소스 프로젝트에서 만들고 공유하고 Creative Commons 2.5 특성 라이선스에 설명된 용어에 따라 사용되는 작업을 기반으로 하는 수정 사항입니다.

적용 대상