title: String cannot be cast to org.JSONObject
body: <p>I have this piece of code that was working and all of a sudden is now throwing a Cast Exception. Have anyone experienced something similar? Thanks.</p>
  
  <pre><code>@Override
  public List&lt;RecordJSONclass&gt; handleResponse(HttpResponse response)
          throws IOException {
      List&lt;RecordJSONclass&gt; result = new ArrayList&lt;RecordJSONclass&gt;();
      String JSONResponse = new BasicResponseHandler().handleResponse(response);
  
      try {
          JSONObject object = (JSONObject) new JSONTokener(JSONResponse).nextValue();
          JSONObject earthquakes = object.getJSONObject("data");
          JSONArray temp = earthquakes.getJSONArray("temperature");
          JSONArray prob = earthquakes.getJSONArray("pop");
  </code></pre>
  
  <p>is throwing a </p>
  
  <blockquote>
    <p>java.lang.ClassCastException: java.lang.String cannot be cast to
    org.json.JSONObject
    at myxmlparser.ResponseHandlerJSON.handleResponse(ResponseHandlerJSON.java:22)</p>
  </blockquote>
  
  <p>The exception happens at line</p>
  
  <blockquote>
    <p>JSONObject object = (JSONObject) new
    JSONTokener(JSONResponse).nextValue();</p>
  </blockquote>
  
  <p>however a String is passed as example in the Class overview in <a href="http://developer.android.com/reference/org/json/JSONTokener.html" rel="nofollow">http://developer.android.com/reference/org/json/JSONTokener.html</a></p>