My response is like this..
{
"IsSuccess": true,
"ResponseObject": ["one", "two", "three", "four", "five"]
}}
i tried to do by creating POJO
. Kindly help me with the solution.
My response is like this..
{
"IsSuccess": true,
"ResponseObject": ["one", "two", "three", "four", "five"]
}}
i tried to do by creating POJO
. Kindly help me with the solution.
Your POJO class should be like this.
public class TempParams {
/**
* IsSuccess : true
* ResponseObject : ["one","two","three","four","five"]
*/
private boolean IsSuccess;
private List<String> ResponseObject;
public boolean isIsSuccess() {
return IsSuccess;
}
public void setIsSuccess(boolean IsSuccess) {
this.IsSuccess = IsSuccess;
}
public List<String> getResponseObject() {
return ResponseObject;
}
public void setResponseObject(List<String> ResponseObject) {
this.ResponseObject = ResponseObject;
}
}
After successfully getting response object you have to convert it like this.
Gson gson = new Gson();
TempParams model = gson.fromJson(mObject.toString(), TempParams.class);
Now you can get value from POJO class.