title: Java parse JSON exception
body: <p>I am trying to parse a JSON String using Java.</p>
  
  <p>This is my code so far:   </p>
  
  <pre><code>    JSONObject obj = new JSONObject(Connection.getDataWOProxy(proxyUseQ));
      JSONArray arr = obj.getJSONArray("result");
      for (int i = 0; i &lt; arr.length(); i++) {
          System.out.println(arr.getInt(i));
      }
  </code></pre>
  
  <p>Info: <code>Connection.getDataWOProxy(proxyUseQ);</code> is a method I wrote that gets the JSON String from an URL using a proxy. <code>proxyUseQ</code> is a boolean that tells the method to use the proxy or not.</p>
  
  <p>What should my code do <strong>normally</strong>:</p>
  
  <pre><code>JSONObject obj = new JSONObject(Connection.getDataWOProxy(proxyUseQ));
  </code></pre>
  
  <p>^ This line initializes my JSONObject giving it the String. Works great.</p>
  
  <pre><code>JSONArray arr = obj.getJSONArray("result");
  </code></pre>
  
  <p>^ Here I want it to access the <code>"result"</code> tree - works as well if I get it right. <strong>Now, if I understood it correctly, all my information should be saved in that Array, is this correct?</strong>   </p>
  
  <pre><code>    for (int i = 0; i &lt; arr.length(); i++) {
          System.out.println(arr.getInt(i));
      }
  </code></pre>
  
  <p>^ Now, I want to access the several information and print e.g. the <code>short_description</code> from <code>result 2</code> (Console output should be: <code>TEST 2</code>). This is where my code fails:</p>
  
  <pre><code>org.json.JSONException: JSONArray[0] is not a number.
  </code></pre>
  
  <p>My JSON String:</p>
  
  <pre><code>{
    "result": [
      {
        "number": "1234",
        "short_description": "TEST",
        "priority": "4 - Low",
        "caller_id": "Some, User"
      },
      {
        "number": "12345",
        "short_description": "TEST 2",
        "priority": "4 - Low",
        "caller_id": "Some, User2"
      }
    ]
  }
  </code></pre>
  
  <p>What am I doing wrong? I am new to JSON. Thanks.</p>