Clockplus/app/src/main/java/com/philliphsu/clock2/OnBootUpReceiver.java
2016-06-14 21:41:14 -07:00

19 lines
724 B
Java

package com.philliphsu.clock2;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
/**
* If the device is turned off, all alarms scheduled will be cancelled, and they will not be automatically
* rescheduled when it is turned on again.
*/
public class OnBootUpReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
// Note that this will be called when the device boots up, not when the app first launches.
// We may have a lot of alarms to reschedule, so do this in the background using an IntentService.
context.startService(new Intent(context, OnBootUpAlarmScheduler.class));
}
}