Pro Android with Kotlin


Download 5.42 Mb.
Pdf ko'rish
bet123/223
Sana04.11.2023
Hajmi5.42 Mb.
#1746807
1   ...   119   120   121   122   123   124   125   126   ...   223
Bog'liq
@de android telegram Pro Android with Kotlin Developing Modern Mobile

139
CHAPTER 8: APIs
The AlarmManager also has a couple of auxiliary methods, as described in Table 
8-5
.
Table 8-4. (continued )
Method
Description
setAndAllowWhileIdle(type: Int, 
triggerAtMillis: Long, operation: 
PendingIntent): Unit
This requires API level 23 or higher. Like set(Int, 
Long, PendingIntent), but this alarm will be allowed 
to execute even when the system is in low-power idle 
modes.
setExact(type: Int, triggerAtMillis: 
Long, operation: PendingIntent): Unit
This requires API level 19 or higher. This schedules an 
alarm to be delivered precisely at the stated time.
setExact(type: Int, triggerAtMillis: 
Long, tag: String, listener: 
AlarmManager.OnAlarmListener, 
targetHandler: Handler): Unit
This requires API level 24 or higher. Direct callback 
version of setExact(Int, Long, PendingIntent). The 
Handler parameter can be null to invoke the listener 
on the app’s main looper. Otherwise, the call of the 
listener will be performed from inside the handler 
provided.
setExactAndAllowWhileIdle( type: Int, 
triggerAtMillis: Long, operation: 
PendingIntent): Unit
This requires API level 23 or higher. Like 
setExact(Int, Long, PendingIntent), but this alarm 
will be allowed to execute even when the system is in 
low-power idle modes.
setInexactRepeating(type: Int, 
triggerAtMillis: Long, intervalMillis: 
Long, operation: PendingIntent): Unit
This schedules a repeating alarm that has inexact 
trigger time requirements; for example, an alarm that 
repeats every hour but not necessarily at the top of 
every hour.
setRepeating(type: Int, triggerAtMillis: 
Long, intervalMillis: Long, operation: 
PendingIntent): Unit
This schedules a repeating alarm. Starting at API level 
19, this is the same as setInexactRepeating().
setWindow(type: Int, windowStartMillis: 
Long, windowLengthMillis: Long, 
operation: PendingIntent): Unit
This schedules an alarm to be delivered within a given 
window of time.
setWindow(int type: Int, 
windowStartMillis: Long, 
windowLengthMillis: Long, tag: String, 
listener: AlarmManager.OnAlarmListener, 
targetHandler: Handler) : Unit
This requires API level 24 or higher. This is a direct 
callback version of setWindow(int, long, long, 
PendingIntent). The Handler parameter can be 
null to invoke the listener on the app’s main looper. 
Otherwise, the call of the listener will be performed 
from inside the handler provided.



Download 5.42 Mb.

Do'stlaringiz bilan baham:
1   ...   119   120   121   122   123   124   125   126   ...   223




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling