remove Alarm from AlarmManager - Android Android OS

Android examples for Android OS:Alarm Set Up

Description

remove Alarm from AlarmManager

Demo Code


//package com.java2s;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;

public class Main {
    public static void removeAlarm(Context context,
            PendingIntent pendingIntent) {
        AlarmManager alarmManager = (AlarmManager) context
                .getSystemService(Context.ALARM_SERVICE);
        alarmManager.cancel(pendingIntent);
    }//from w w w . j a  v  a 2s.  c o  m
}

Related Tutorials