{"result":[{"heading":"The City School","text":"Established in 1978"}]}
please help printing this type to json
format?
{"result":[{"heading":"The City School","text":"Established in 1978"}]}
please help printing this type to json
format?
Try this code
String jsonStr = "{'result':[{'heading':'The City School','text':'Established in 1978'}]}";
try {
JSONObject jsonObj = new JSONObject(jsonStr);
String headingVal=jsonObj.getDouble("heading");
String textVal=jsonObj.getDouble("text");
System.out.println("Heading --"+headingVal);
System.out.println("Text--"+textVal);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}