piyush kalsariya piyush kalsariya - 1 year ago 259
Android Question

Implementing BroadcastReceiver inside JobService

I am working on an application that uses JobService. Now, in my app i want to reschedule the Broadcast receiver that is working in the background. So, i want to know if i can implement BroadcastReceiver inside JobService so that it can restart after several times.

Answer Source

Yes it is possible. If it's background service, use PowerManager and WakeLock to keep CPU running while you you restart your service. Btw why you need to restart it?


if you want to keep alive your service return START_STICKY in your onStartCommand()

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download