1

Hello I am working on android application where I want to use LocalBroadCastManager. I want to perform network operation in service and send result to activity from there using LocalBroadCastManager.

Is it possible to do that using LocalBroadCastManager or Do I have to do same in different method ?

Thanks in advance.

N Sharma
  • 33,489
  • 95
  • 256
  • 444

2 Answers2

0

Yes, you can ! But be sure to not use this service in another process ! Check your manifest and see if where you declared your service you haven't used the tag android:process, if you haven't you are good to go !

Leonardo
  • 3,141
  • 3
  • 31
  • 60
0

Unless you have a reason to do the network operation in a service, you should take a look at AsyncTask, or even Retrofit

nPn
  • 16,254
  • 9
  • 35
  • 58