I need get some progress of my intent service, but in my search I find the resultReceiver
and looks good and easy to implement, but the examples what I see pass the receiver throw intent but a can't pass because my intent service its activate by BroadcastReceiver
. So, I get the progress of intentService
when the user enter in some activity.
Asked
Active
Viewed 58 times
0

Simson
- 3,373
- 2
- 24
- 38

Felipe Custódio
- 102
- 4
- 13
1 Answers
0
If you already start your IntentService and don't pass ResultReceiver with this call, there is no way to pass it while IntentService will executed your onHandleIntent(). In this case you can make your own Service that will have something like onHandleIntent() that will be executed on HandlerThread (IntentService make the same thing under the hood). So with a simple Service you can receive your ResultReceiver in onStartCommand() and make some callback to your UI by checking for instance of ResultReceiver in onHandleIntent()

HeyAlex
- 1,666
- 1
- 13
- 31