Example usage for android.app AlarmManager cancel

List of usage examples for android.app AlarmManager cancel

Introduction

In this page you can find the example usage for android.app AlarmManager cancel.

Prototype

public void cancel(OnAlarmListener listener) 

Source Link

Document

Remove any alarm scheduled to be delivered to the given OnAlarmListener .

Usage

From source file:com.codename1.impl.android.AndroidImplementation.java

public void cancelLocalNotification(String notificationId) {
    Intent notificationIntent = new Intent(getContext(), LocalNotificationPublisher.class);
    notificationIntent.setAction(getContext().getApplicationInfo().packageName + "." + notificationId);

    PendingIntent pendingIntent = PendingIntent.getBroadcast(getContext(), 0, notificationIntent,
            PendingIntent.FLAG_UPDATE_CURRENT);
    AlarmManager alarmManager = (AlarmManager) getContext().getSystemService(Context.ALARM_SERVICE);
    alarmManager.cancel(pendingIntent);
}