Code example for Intent

Methods: getService

0
    }; 
     
    public static void resetAlarm(Context context, long interval) {
        // Create an IntentSender that will launch our service, to be scheduled 
        // with the alarm manager. 
        PendingIntent alarmSender = PendingIntent.getService(context, 0, new Intent(context, EnvelopeService.class), 0);
        AlarmManager am = (AlarmManager) context.getSystemService(ALARM_SERVICE);
        am.cancel(alarmSender);
        if (interval != 0)
        	am.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime(), interval, alarmSender);
    } 
} 
 
Stop searching for code, let great code find you!  Add Codota to your java IDE