if(jsonArray != null)
// Here You may not have any key like 'success' so i don't have taken.
// You can directly get JSON Object here.. If you are getting more than one JSONObject then make loop here...
JSONObject object = jsonArray.getJSONObject(0);
// Now you can do with object that you want to do.
Comment comment = new Comment();
I wish this help you From your url, the data is a JSON array. You are trying to create a JSONObject from the String of a JSONArray. It cannot work this way. Create a JSONArray instead. Also, still from your url, there is no key 'posts' anywhere in your json.
Android JSON parsing 'data of type org.json.JSONObject cannot be converted to JSONArray' error