Example usage for android.content Context ALARM_SERVICE

List of usage examples for android.content Context ALARM_SERVICE

Introduction

In this page you can find the example usage for android.content Context ALARM_SERVICE.

Prototype

String ALARM_SERVICE

To view the source code for android.content Context ALARM_SERVICE.

Click Source Link

Document

Use with #getSystemService(String) to retrieve a android.app.AlarmManager for receiving intents at a time of your choosing.

Usage

From source file:Main.java

public static AlarmManager getAlarmManager(Context ctx) {
    return (AlarmManager) ctx.getSystemService(Context.ALARM_SERVICE);
}

From source file:Main.java

private static AlarmManager alarmManager(Context con) {
    return (AlarmManager) con.getSystemService(Context.ALARM_SERVICE);
}

From source file:Main.java

private static AlarmManager am(Context context) {
    return (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
}

From source file:Main.java

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

From source file:Main.java

public static AlarmManager getAlarmManager(Context context) {
    return (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
}

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 cancel(Context context, PendingIntent pendingIntent) {
    AlarmManager alarmManager = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);

    alarmManager.cancel(pendingIntent);/* w ww  . ja  v a 2s  .c  o  m*/
}

From source file:Main.java

public static void cancelAlarm(Context context, int id) {
    AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
    Intent intent = new Intent("myAlarmClock");
    PendingIntent pdi = PendingIntent.getBroadcast(context, id, intent, PendingIntent.FLAG_CANCEL_CURRENT);
    am.cancel(pdi);/*from   www .j  a  v a2 s  .  co m*/
}

From source file:Main.java

public static final void Alarm_service(Context ctx, long atTime, Class<?> cls) {
    ((AlarmManager) ctx.getSystemService(Context.ALARM_SERVICE)).set(AlarmManager.RTC_WAKEUP, atTime,
            PendingIntent.getService(ctx, 0, new Intent(ctx, cls), 0));
}

From source file:Main.java

public static AlarmManager getAlarmManager(Context ctx) {
    if (alarmManager == null) {
        alarmManager = (AlarmManager) ctx.getSystemService(Context.ALARM_SERVICE);
    }/*w  w w .j  av a  2s .  com*/
    return alarmManager;
}