I am currently making a get request using volley and in onResponse i am trying to parse the jsonObject using gson to my model.
JSON Returned after the request is made:
i have a really easy approach for you:
first of all create the main model: and the other one for "data"
public class FeedBackModel {
int success;
String message;
DataModel data;
}
public class DataModel {
String company;
String email;
//etc ...
}
// create getter& setter for variables
then when you got json, parse it like this:
Gson gson = new Gson();
Type CollectionType = new TypeToken<FeedBackModel>() {
}.getType();
FeedBackModel FeedBack = gson.fromJson(json, CollectionType);
There is a little mistake in your code.So you should change ClientData clientData to ClientData data. Then you can get the data.Hope this will help you in parsing.
As Mentioned by user1912026, change as below.
private ClientData data;
And change the setter and getter as below
public ClientData getClientData() {
return data;
}
public void setClientData(ClientData clientData) {
this.data = clientData;
}