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:Main.java

public static void cancel(Context context, PendingIntent pi) {
    AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
    am.cancel(pi);

}

From source file:Main.java

public static void canalAlarm(Context context, String action) {
    Intent intent = new Intent(action);
    PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_CANCEL_CURRENT);
    AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
    am.cancel(pi);
}

From source file:Main.java

public static void cancelAlarm(Context context, String action, int id) {
    Intent intent = new Intent(action);
    PendingIntent pi = PendingIntent.getBroadcast(context, id, intent, PendingIntent.FLAG_CANCEL_CURRENT);
    AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
    am.cancel(pi);
}

From source file:Main.java

@TargetApi(Build.VERSION_CODES.CUPCAKE)
public static void stopAlarmIntent(Context context, PendingIntent pendingIntent) {
    AlarmManager manager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
    manager.cancel(pendingIntent);
}

From source file:Main.java

public static void cancelAlarm(Context context, PendingIntent intent) {
    AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
    alarmManager.cancel(intent);
}

From source file:Main.java

public static void cancel(Context context, PendingIntent pendingIntent) {
    AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);

    alarmManager.cancel(pendingIntent);
}

From source file:Main.java

public static void cancel(Context context, Intent intent) {
    PendingIntent p = PendingIntent.getBroadcast(context, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT);

    AlarmManager alarm = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);

    alarm.cancel(p);
    Log.d("petsitter-alarm", "Alarme cancelado.");
}

From source file:Main.java

public static void cancelAlarm(View view, AlarmManager mTrunchCheckerAlarm,
        PendingIntent mPendingCheckerIntent) {
    if (mTrunchCheckerAlarm != null) {
        mTrunchCheckerAlarm.cancel(mPendingCheckerIntent);
    }/*w  w  w .  j  ava2  s  .c  o  m*/
}

From source file:com.alchemiasoft.book.receiver.SuggestionReceiver.java

public static void cancelSuggestion(Context context) {
    if (sPendingIntent != null) {
        Log.d(TAG_LOG, "AlarmReceiver: cancelling pending suggestion.");
        final AlarmManager alarmManager = AlarmUtil.getAlarmManager(context);
        alarmManager.cancel(sPendingIntent);
    }/*from w w  w  .  j a  va 2  s  . c  om*/
}

From source file:de.escoand.readdaily.ReminderHandler.java

public static void endReminder(final Context context) {
    Intent intent = new Intent(context, ReminderHandler.class);
    PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 0, intent,
            PendingIntent.FLAG_UPDATE_CURRENT);
    AlarmManager am = (AlarmManager) context.getSystemService(Activity.ALARM_SERVICE);

    am.cancel(pendingIntent);

    LogHandler.log(Log.WARN, "deactivated");
}