I have the problem removing the alarm which I already set. I used two activities to "ADD" or "EDIT" alarms. When I delete an alarm, I want to use the activity which is made to show list of alarms. However, It doesn't delete the PendingIntent I set.
Here's the part of my source code in List Activity.
private void removeAlarm(int number)
{
final int alarmCode = AlarmCodeCreator.CreateNum(1, clickedPosition, 0);
AlarmManager alarmManager = (AlarmManager)getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(ListMainActivity.this,
PushMainActivity.class);
PendingIntent pendingIntent = PendingIntent.getBroadcast(
getApplicationContext(), alarmCode, intent, 0);
alarmManager.cancel(pendingIntent);
System.out.println(alarmCode);
}