stop Alarm Service - Android Android OS

Android examples for Android OS:Alarm Set Up

Description

stop Alarm Service

Demo Code


import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import org.w3c.dom.ProcessingInstruction;
import java.util.Calendar;

public class Main{
    private static AlarmManager sAlarmManager;
    private static PendingIntent sPendingIntent;
    private static final String TAG = AlarmUtils.class.getName();
    public static void stopService() {
        if (sPendingIntent != null && sAlarmManager != null) {
            sAlarmManager.cancel(sPendingIntent);
            LogUtils.log(TAG, "Alarm has been stopped.");
        }/*www.  ja v a 2s .c o  m*/
    }
}

Related Tutorials