title: Issuse with pasrsing JSON Response in String
body: <pre><code>public class Restcaliing extends AsyncTask&lt;String, String, String&gt; {
  
      JsonParser jsonParser = new JsonParser();
  
      @Override
      protected String doInBackground(String... arg0) {
          try {
              // (http Calling)
  
              ServiceHandler serviceHandler = new ServiceHandler();
  
              reststring = serviceHandler.makeServiceCall(prepaerdurl, ServiceHandler.GET);
  
              jsonParser.parse(restString);
  
              Log.d("Response String", "" + jsonParser.parse(restString));
  
  
          } catch (Exception e) {
              e.printStackTrace();
              Log.d("catach", "Exception");
          }
          return null;
      }
  }
  </code></pre>
  
  <p>In <code>doInBackground()</code> method sending request to the server and receive response in string but when I convert this string in JSONObject it returns this exception:</p>
  
  <blockquote>
    <p>String cannot be cast in JSONObject     </p>
  </blockquote>
  
  <p>This is string I got in <code>reststring</code> variable:</p>
  
  <pre><code>"{\n \"assigmentlist\" : [ {\n \"attributes\" : {\n \"type\" : \"Assigment__c\",\n \"url\" : \"/services/data/v34.0/sobjects/Assigment__c/a0128000005CZIsAAO\"\n },\n \"Id\" : \"a0128000005CZIsAAO\",\n \"Class__c\" : \"1st\",\n \"Credit__c\" : \"1\",\n \"Division__c\" : \"A\",\n \"Subject__c\" : \"Maths\",\n \"Submission_Date__c\" : \"7/25/2015 7:08:00 AM GMT\"\n } ]\n}" 
  </code></pre>