title: How to select a certain data from JSON
body: <p>I'm developing an Android application, I have to implement a function that parse my JSON and return to me certain result.</p>
  
  <p>For example, I have a JSON with this strcutures:</p>
  
  <pre><code>[  
     {  
        "date":"17-06-2016",
        "desc":"My description",
        "id":"9",
        "img":"http:\/\/myurl\/pathimage\/image.jpg",
        "text":"Lorem Ipsum.",
        "title":"My title"
     },   {  
        "date":"14-06-2015",
        "desc":"My description 2",
        "id":"5",
        "img":"http:\/\/myurl\/pathimage\/image.jpg",
        "text":"Lorem Ipsum 2.",
        "title":"My title 2"
     }
  
  ]
  </code></pre>
  
  <p>I need to select ONLY the object with id = 9, how i can do this ?
  How i can select programmatically the JSON object discriminating respect the id ? </p>
  
  <p>I know how to parse JSON, <strong>but i DON'T know how to select programmatically the JSON object discriminating respect the id.</strong> </p>
  
  <p>****** EDIT 1 ******</p>
  
  <pre><code>JSONArray newsReq;
          try {
              newsReq = new JSONArray(result.toString());
              for (int i = 0; i &lt; newsReq.length(); i++) {
                  try {
                    if(obj.getInt("id")=='9'){
                      JSONObject obj = newsReq.getJSONObject(i);
                      obj.getString("img");
                      obj.getInt("id");
                      obj.getString("title");
                   }
                  } catch (JSONException e) {
                      Log.wtf("BulgariLog: ", e);
                  }
              }
          } catch (JSONException e) {
              Log.wtf("BulgariLog: ", e);
          }
  </code></pre>