how to directly parse JSONdata using JSONObject in java as my JSON Data don't have any JSONArray .
JSONData:-
{{
"id": 481,
"date": "2016-12-30T13:56:10",
"date_gmt": "2016-12-30T13:56:10",
"guid": {
"rendered": "http://www.mytrendin.com/wp-content/uploads/2016/12/read- 1710011_1280.jpg"
},
"modified": "2016-12-30T13:56:20",
"modified_gmt": "2016-12-30T13:56:20",
"slug": "read-1710011_1280",
"type": "attachment",
"link": "http://www.mytrendin.com/increase-child-development/read-1710011_1280/",
"title": {
"rendered": "child development"
}}
java code
jsonObject = new JSONObject(results);
for(i=0;i<jsonObject.length();i++){
jsonObject=jsonObject.getJSONObject();
j = jsonObject.getString("type");
// mainActivityModel.setId();
}