Last active
May 29, 2018 19:20
-
-
Save pedromassango/bf5c7bc9827ebf53a0566e50e082e270 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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