title: String cannot be converted to JSONObject exception
body: <p>Newbie to Json here, I'm gettin a  <em>Value Database of type java.lang.String cannot be converted to JSONObject</em> error when I try and run the following code.I cant make any sense of other answers on here.</p>
  
  <pre><code>       JSONObject jsonObject = new JSONObject(json);
         JSONArray jsonArray = jsonObject.getJSONArray("server_response");
         JSONObject JN = jsonArray.getJSONObject(0);
         String code =JN.getString("code");
         String message = JN.getString("message");
         if (code.equals("reg_true"))
         {
             showDialog("Your Registration has been successful.",message,code);
         }
         else if (code.equals("reg_false"))
         {
             showDialog("Your Registration Failed.",message,code);
         }
  
  
     } catch (JSONException e){
         e.printStackTrace();
     }
  </code></pre>
  
  <p>This is the error </p>
  
  <pre><code> W/System.err﹕ org.json.JSONException: Value Database of type   java.lang.String cannot be converted to JSONObject
   W/System.err﹕ at org.json.JSON.typeMismatch(JSON.java:111)
   W/System.err﹕ at org.json.JSONObject.&lt;init&gt;(JSONObject.java:160)
   W/System.err﹕ at org.json.JSONObject.&lt;init&gt;(JSONObject.java:173)
   W/System.err﹕ at com.example.project.BackgroundTask.onPostExecute(BackgroundTask.java:133)
   W/System.err﹕ at com.example.project.BackgroundTask.onPostExecute(BackgroundTask.java:29)
  </code></pre>