-
-
Save garg-lucifer/36622ce8db0574c6fa24ccd738d2462c to your computer and use it in GitHub Desktop.
This file contains 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
private fun removeAlarm(taskInfo: TaskInfo){ | |
val alarmManager = activity?.getSystemService(Context.ALARM_SERVICE) as AlarmManager | |
val intent = Intent(requireContext(), AlarmReceiver::class.java) | |
// It is not necessary to add putExtra | |
intent.putExtra("task_info", taskInfo) | |
val pendingIntent = PendingIntent.getBroadcast(requireContext(), taskInfo.id, intent, PendingIntent.FLAG_IMMUTABLE) | |
alarmManager.cancel(pendingIntent) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment