开发者

How to implement callbacks using IntentService on Android?

开发者 https://www.devze.com 2023-01-19 23:21 出处:网络
If it must implement with AIDL? And please kindly provide an example, thanks. EDIT: There are several solutions, Does anyone k开发者_开发知识库now which is better?You might be looking for the ResultR

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

EDIT: There are several solutions, Does anyone k开发者_开发知识库now which is better?


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.


checkout this post :Using ResultReceiver in Android , discussing the implementation of resutlreceiver.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号