I am trying to parse a JSON response from a server, If there are changes to in the query sent in post method I will get first one as response, if not I will get the second o
try this,
try {
// "data" returns an object
JSONObject jsonObjectData = jsonObject.getJSONObject("data");
//rest of your code
} catch (JSONException e){
//"data" returns a string
e.printStackTrace();
try {
String data = jsonObject.getString("data");
} catch (JSONException e1) {
e1.printStackTrace();
}
}