PendingIntent and Alarms

Report a typo

Rachel needs your help making a one-time alarm to fire the PendingIntent. Could you help her?

val intent = Intent(applicationContext, Receiver::class.java)
val pIntent = PendingIntent.getBroadcast(this, 1, intent, PendingIntent.FLAG_IMMUTABLE)
val selectedTime = calendar.timeInMillis

val alarmManager: AlarmManager = getSystemService(ALARM_SERVICE) as AlarmManager
// Call the AlarmManager to set a one-time alarm and provide its arguments 
Enter a short text
___

Create a free account to access the full topic