Skip to content

Instantly share code, notes, and snippets.

@pedromassango
Last active May 29, 2018 19:20
Show Gist options
  • Select an option

  • Save pedromassango/bf5c7bc9827ebf53a0566e50e082e270 to your computer and use it in GitHub Desktop.

Select an option

Save pedromassango/bf5c7bc9827ebf53a0566e50e082e270 to your computer and use it in GitHub Desktop.
// Request the AlarmManager object
val manager = getSystemService(Context.ALARM_SERVICE) as AlarmManager
// Create the PendingIntent that would have launched the BroadcastReceiver
val pending = PendingIntent.getBroadcast(
this, 0,
Intent(this, AlarmBroadcastReceiver::class.java), 0
)
// Cancel the alarm associated with that PendingIntent
manager.cancel(pending)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment