Android job scheduler not persisted on reboot
Register a BroadCastReciever
for detecting BOOT_COMPLETED
.
<receiver android:name="com.example.startuptest.StartUpBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
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.