public class JsonAsyncHttpResponse extends AsyncHttpResponse
| Modifier and Type | Field and Description |
|---|---|
protected static int |
SUCCESS_JSON
Indicate the JSON has a valid json and a success message
|
FAIL, FINISH, START, SUCCESS| Constructor and Description |
|---|
JsonAsyncHttpResponse() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
handleMessage(Message message) |
protected void |
handleSuccessJsonMessage(int stautsCode,
java.lang.Object jsonResponse)
Handle the success json message and call the onSuccess callback or the onError
|
void |
onSuccess(int statusCode,
JSONArray response)
Callback that indicate request has finished success
and its a JSONArray
|
void |
onSuccess(int statusCode,
JSONObject response)
Callback that indicate request has finished success
and its a JSONObject
|
protected void |
sendSuccessMessage(int statusCode,
java.lang.String responseBody)
Send the success message to the handler
|
handleFailMessage, handleSuccessMessage, obtainMessage, onError, onFinish, onStart, sendEndMessage, sendFailMessage, sendMessage, sendStartMessageprotected static final int SUCCESS_JSON
public void onSuccess(int statusCode,
JSONObject response)
onSuccess in class AsyncHttpResponsestatusCode - the status code of the request normally 200response - the JSON response of this requestpublic void onSuccess(int statusCode,
JSONArray response)
onSuccess in class AsyncHttpResponsestatusCode - the status code of the request normally 200response - the JSON response of this requestprotected void sendSuccessMessage(int statusCode,
java.lang.String responseBody)
AsyncHttpResponsesendSuccessMessage in class AsyncHttpResponsestatusCode - the success request status code (normally 200 or 202)responseBody - the response body of the request (if any) or nullpublic boolean handleMessage(Message message)
handleMessage in class AsyncHttpResponseprotected void handleSuccessJsonMessage(int stautsCode,
java.lang.Object jsonResponse)
stautsCode - the message status code of this requestjsonResponse - the response parsed ready to get instances#onSuccess(int, org.json.JSONObject),
#onSuccess(int, org.json.JSONArray),
AsyncHttpResponse.onError(Throwable, String)