I am building an app that set 2 alarms for each day of the week (at a certain hour and minute), the alarms repeat week after week forever.
Now the point is: if the u
I had same problem for cancelling alarms, and solved it. What you should do is simply do -
Call cancel() of AlarmManager and pass the PendingIntent object in it, and alarm will be cancelled.
private void cancelAlarm(int requestCode) {
AlarmManager alarmManager2 = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
PendingIntent pendingIntent2 = PendingIntent.getBroadcast(getApplicationContext(),requestCode,new Intent(this, MyBroadCastReceiver.class),0);
alarmManager2.cancel(pendingIntent2);
Toast.makeText(getApplicationContext(), "Alarm Cancelled - "+ requestCode, Toast.LENGTH_LONG).show();
}