title: Convert String into json array object...android
body: <p>I get from the server array of objects, and by this code I convert it to json:</p>
  
  <pre><code>public static ArrayList&lt;bussListCubic&gt; parseBussinessArray(String result) {
      ArrayList&lt;bussListCubic&gt; arr = new ArrayList&lt;bussListCubic&gt;();
          try {
            JSONArray jArray = new JSONArray(result);
            JSONObject json_data = null;
            for (int i = 0; i &lt; jArray.length(); i++) {
               json_data = jArray.getJSONObject(i);
           bussListCubic userInfo = parseBussListCubic(json_data);
           arr.add(userInfo);
        }
          } catch (JSONException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
  }
  return arr;
  </code></pre>
  
  <p>}</p>
  
  <p>Some times the app crashed and this is the error:</p>
  
  <pre><code>Caused by: java.lang.NullPointerException at
  org.json.JSONTokener.nextCleanInternal(JSONTokener.java:116) at
  org.json.JSONTokener.nextValue(JSONTokener.java:94) at
  org.json.JSONArray.&lt;init&gt;(JSONArray.java:87) at
  org.json.JSONArray.&lt;init&gt;(JSONArray.java:103)
  </code></pre>
  
  <p>it is also point that the error with this line :
  <code>JSONArray jArray = new JSONArray(result)</code>: line #4 in the above code...what does this error mean ?</p>
  
  <p>thank you</p>