title: “json parsing error: Value true at error of type java.lang.Boolean cannot be converted to JSONObject”
body: <p>// this is the request method </p>
  
  <pre><code>    HashMap&lt;String, String&gt; params = new HashMap&lt;String, String&gt;();
      params.put("userName",sharedPreferences.getString("name",""));
      params.put("PhoneNumber",sharedPreferences.getString("phone",""));
      params.put("txtMsg",massege.getText().toString());
  
      JsonObjectRequest req = new JsonObjectRequest(url, new JSONObject(params),
              new Response.Listener&lt;JSONObject&gt;() {
                  @Override
                  public void onResponse(JSONObject response) {
                      try {
                          String code=  response.getString("code");
                          Toast.makeText(getContext(), ""+response.toString(), Toast.LENGTH_SHORT).show();
  
                          if(code.equals("200")){
                              massege.setVisibility(View.GONE);
                              send.setVisibility(View.GONE);
                              responsemsg.setVisibility(View.VISIBLE);
                          }
                          else {
  
                          }
                          VolleyLog.v("Response:%n %s", response.toString(4));
  
                      } catch (JSONException e) {
                          e.printStackTrace();
                      }
                  }
              }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              VolleyLog.e("Error: ", error.getMessage());
              Toast.makeText(getContext(), ""+error.getMessage(), Toast.LENGTH_SHORT).show();
          }
      });
      AppController.getInstance().addToRequestQueue(req);[enter image description here][1]
  </code></pre>
  
  <p>get the text from EditText and send to the server using volley. But when I'm executing it, application showing an error:</p>
  
  <p><a href="https://i.stack.imgur.com/ZNv4D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZNv4D.png" alt="enter image description here"></a></p>
  
  <p>What is wrong here???</p>