I have implemented Job scheduler in my project and it works fine in the case if the app is in background or if the app is killed. But it is not working if the device is rebo
Register a BroadCastReciever for detecting BOOT_COMPLETED.
And in your BroadcastReceiver:
public class StartUpBootReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
Log.d("startuptest", "StartUpBootReceiver BOOT_COMPLETED");
...
}
}
}
Once a user runs any activity in your app once, you will receive the BOOT_COMPLETED broadcast after all future boots.