views:

42

answers:

1

If it must implement with AIDL? And please kindly provide an example, thanks.

EDIT: There are several solutions, Does anyone know which is better?

A: 

You might be looking for the ResultReceiver class (http://developer.android.com/reference/android/os/ResultReceiver.html) . You extend it, pass it along with the intent you invoke the Service with (it's parcelable), then when your task completes in the Service, you call the ResultReceiver's onReceiveResult() method with the results.

Scythe
Thanks! Is there any alternative solution? I would like to know.
shiami
Well tell us if you've found any, because I couldn't find any better solutions. I don't really like it either, tho it does work.
Scythe
I think the broadcast/receiver should work but have no idea if it is better or not.
shiami
I'm trying to use static Handler to send message back to main thread now. I think there must be mutiple solutions but which is better?
shiami