-2

am developing an app which will automatically uploads data in background(which are stored in offline) to the back end when the device network connected. For this i have implemented broadcast receiver in manifest. it works fine but in above nougat devices, the broadcast receiver does not triggers for CONNECTIVITY_ACTION .

so that, i implemented the job scheduler technique. In that also the broadcast receiver does not triggers. please help

Grace Venkat
  • 189
  • 1
  • 10

1 Answers1

0

Apps running Android N does not receive the CONNECTIVITY_ACTION notification broadcast. By Using JobScheduler your Job service will be automatically invoked by Android run time, there is no need of broadcast receiver. Use the below method of JobScheduler

.setRequiredNetworkType(JobInfo.NETWORK_TYPE_ANY)