title: Android, Parsing JSON object
body: <p>When i call server its response is based of json object. Actually, I know how to parse JSON object but this response is strange for me. Server response is:</p>
  
  <pre><code>{"body":"Not Available!","clazz":"SoccerMatchPreview","id":{"inc":-2024241794,"machine":415106952,"new":false,"time":1337861978000,"timeSecond":1337861978},"publishedDate":"2012-06-08 17:00:00 +0100","refKey":"SoccerMatchPreview_4fb897be18be8b87f9117595","title":"Poland vs Greece"}
  </code></pre>
  
  <p>Those Information that I need are body, publishedDate, refKey and title. The code that i have written based of JSON object is this:</p>
  
  <pre><code>JSONObject jObject = new JSONObject(response);
                      JSONArray contestantObjects = jObject.getJSONArray("id");
                      for(int i=0; i&lt;contestantObjects.length(); i++) {
                          mPreview.setBody(contestantObjects.getJSONObject(i).getString("body").toString());
                          mPreview.setPublishedDate(contestantObjects.getJSONObject(i).getString("publishedDate").toString());
                          mPreview.setRefKey(contestantObjects.getJSONObject(i).getString("refKey").toString());
                          mPreview.setTitle(contestantObjects.getJSONObject(i).getString("title").toString());
                      }
  </code></pre>
  
  <p>But because it doesn't have "[]" I think it's not JSON object. therefore, I wrote another code based JSON array. </p>
  
  <pre><code>JSONArray contestantObjects = new JSONArray(response);
                      for(int i=0; i&lt;contestantObjects.length(); i++) {
                          mPreview.setBody(contestantObjects.getJSONObject(i).getString("body").toString());
                          mPreview.setPublishedDate(contestantObjects.getJSONObject(i).getString("publishedDate").toString());
                          mPreview.setRefKey(contestantObjects.getJSONObject(i).getString("refKey").toString());
                          mPreview.setTitle(contestantObjects.getJSONObject(i).getString("title").toString());
                      }
  </code></pre>
  
  <p>but result is same and Logcat shows:</p>
  
  <blockquote>
    <p>Value {"id":{"timeSecond":1337861978,"time":1337861978000,"new":false,"machine":415106952,"inc":-2024241794},"body":"Not Available!","title":"Poland vs Greece","publishedDate":"2012-06-08 17:00:00 +0100","clazz":"SoccerMatchPreview","refKey":"SoccerMatchPreview_4fb897be18be8b87f9117595"} of type org.json.JSONObject cannot be converted to JSONArray</p>
  </blockquote>
  
  <p>any suggestion would be appreciated. Thanks</p>