My AppWidgetProvider (which, of course, BroadcastReceiver ) is registered to receive CONNECTIVITY_CHANGE , so I can update widgets immediately after restoring the network (although only if necessary, that is, if the previous update was skipped due to lack of connection).
But as stated here , this will no longer be possible in Android N. It is supposed to use JobScheduler , which allows you to run the task only when connected to the network using the .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY) method.
However, I do not see how this can be used to replicate my desired behavior. It seems to me that the .setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY) method will cause Job to not run at all if there is no network at the time the job is assigned and it will not . > make Job wait patiently until the network appears, and then run (what I need).
So, how do I save the behavior I need with Android N?
source share