2
    [
  {
    "school_id": "1",
    "name": "Air University"
  },
  {
    "school_id": "2",
    "name": "Alabama A&M University"
  },
  {
    "school_id": "3",
    "name": "Alabama State University"
  },
  {
    "school_id": "4",
    "name": "Amridge University"
  },
  {
    "school_id": "5",
    "name": "Athens State University"
  },
  {
    "school_id": "6",
    "name": "Auburn University"
  }
]

How can parse that type response in retrofit 1.9 give me some hint?

3
  • What you have try ? Commented Jun 25, 2016 at 5:05
  • Questions seeking help must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example. Commented Jun 25, 2016 at 5:17
  • Please add more details in question. Commented Jun 25, 2016 at 5:31

1 Answer 1

4

I am assuming your api responds with an array of objects and you want to get a callback for that. You can do it as,

@GET('your url')
void getSchools(Callback<ArrayList<School>> callback);

where the school class is,

public class School {
    String schoolId;
    String name;
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.