use of android.app.AlarmManager in project cw-omnibus by commonsguy.
the class PollReceiver method scheduleAlarms.
static void scheduleAlarms(Context ctxt) {
AlarmManager mgr = (AlarmManager) ctxt.getSystemService(Context.ALARM_SERVICE);
Thingy thingy = new Thingy(mgr.getClass().getCanonicalName(), mgr.hashCode());
Intent i = new Intent(ctxt, PollReceiver.class).putExtra(EXTRA_THINGY, Parcelables.toByteArray(thingy));
PendingIntent pi = PendingIntent.getBroadcast(ctxt, 0, i, 0);
mgr.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + INITIAL_DELAY, PERIOD, pi);
}
use of android.app.AlarmManager in project cw-omnibus by commonsguy.
the class MainActivity method notifyMe.
public void notifyMe(View v) {
Intent i = new Intent(this, AlarmReceiver.class).putExtra(AlarmReceiver.EXTRA_TYPE, type.getSelectedItemPosition());
PendingIntent pi = PendingIntent.getBroadcast(this, 0, i, PendingIntent.FLAG_UPDATE_CURRENT);
AlarmManager mgr = (AlarmManager) getSystemService(ALARM_SERVICE);
mgr.set(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + (1000 * delay.getProgress()), pi);
}
use of android.app.AlarmManager in project cw-omnibus by commonsguy.
the class PollReceiver method scheduleAlarms.
static void scheduleAlarms(Context ctxt) {
AlarmManager mgr = (AlarmManager) ctxt.getSystemService(Context.ALARM_SERVICE);
Intent i = new Intent(ctxt, PollReceiver.class);
PendingIntent pi = PendingIntent.getBroadcast(ctxt, 0, i, 0);
Intent i2 = new Intent(ctxt, EventDemoActivity.class);
PendingIntent pi2 = PendingIntent.getActivity(ctxt, 0, i2, 0);
AlarmManager.AlarmClockInfo ac = new AlarmManager.AlarmClockInfo(System.currentTimeMillis() + PERIOD, pi2);
mgr.setAlarmClock(ac, pi);
}
use of android.app.AlarmManager in project cw-omnibus by commonsguy.
the class PollReceiver method scheduleAlarms.
static void scheduleAlarms(Context ctxt) {
AlarmManager mgr = (AlarmManager) ctxt.getSystemService(Context.ALARM_SERVICE);
Intent i = new Intent(ctxt, PollReceiver.class);
PendingIntent pi = PendingIntent.getBroadcast(ctxt, 0, i, 0);
mgr.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + INITIAL_DELAY, PERIOD, pi);
}
use of android.app.AlarmManager in project cw-omnibus by commonsguy.
the class PollReceiver method scheduleAlarms.
static void scheduleAlarms(Context ctxt) {
AlarmManager mgr = (AlarmManager) ctxt.getSystemService(Context.ALARM_SERVICE);
Intent i = new Intent(ctxt, PollReceiver.class);
PendingIntent pi = PendingIntent.getBroadcast(ctxt, 0, i, 0);
mgr.setRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, SystemClock.elapsedRealtime() + INITIAL_DELAY, PERIOD, pi);
}
Aggregations