Back to project page RestLib.
The source code is released under:
MIT License
If you think the Android project RestLib listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package github.crazymumu.restlib; /*from w w w. j a v a2 s.c o m*/ import android.os.Bundle; import android.os.Handler; import android.os.ResultReceiver; /** * Declares a RestResult receiver as one of the activity's member. RestResult * receivers enable activity to receive results from the RestService. * * @author Crazy MuMu */ public class RestResultReceiver extends ResultReceiver { private RestResult receiver; public RestResultReceiver() { super(new Handler()); } public RestResultReceiver(Handler handler) { super(handler); } public void setReceiver(RestResult receiver) { this.receiver = receiver; } @Override protected void onReceiveResult(int resultCode, Bundle resultData) { if (receiver != null && resultData != null) { RestResponse response = resultData.getParcelable(RestService.RESULT); receiver.onReceiveRestResult(response); } } }