Normally you can parse as
String response = "[{"Id": 2293,"Name": "Dr.","Active": true},{"Id": 2305,"Name": "Mr.","Active": true},{"Id": 2315,"Name": "Mrs.","Active": true}]";
try {
JSONArray ja = new JSONArray(response);
for (int i = 0; i < ja.length(); i++) {
JSONObject jo = ja.getJSONObject(i);
String id = jo.getString("Id");
String name = jo.getString("Name");
String active = jo.getString("Active");
}
} catch (JSONException e) {
e.printStackTrace();
}
If you want to parse it using Model Class
then your Model Class
will be for Retrofit
class Response
{
@SerializedName("Id")
@Expose
private String id;
@SerializedName("Name")
@Expose
private String name;
@SerializedName("Active")
@Expose
private String active;
}
and define Callback for retrofit like that
Call<List<Meeting>> getMeetings(@Field String data );
Hope this will help