title: How to convert String to JSONObject?
body: <p>I have an obstacle by changing the data string into a jsonobject, is his org.json.JSONException script error: Value 
  
  <p>This coding I am trying</p>
  
  <pre><code>btnLogin.setOnClickListener(new View.OnClickListener() {
          public void onClick(View v) {
  
              String username = inputUser.getText().toString().trim();
              String password = inputPassword.getText().toString().trim();
  
              // Check for empty data in the form
              if (username.trim().length() &gt; 0 &amp;&amp; password.trim().length() &gt; 0) {
                  Map&lt;String,String&gt; params = new HashMap&lt;&gt;();
                  params.put("username", inputUser.getText().toString());
                  params.put("password", inputPassword.getText().toString());
                  sendPostRequest(params);
              } else {
                  // Prompt user to enter credentials
                  Toast.makeText(getApplicationContext(),
                          "Silahkan Masukan Username dan Password!", Toast.LENGTH_LONG)
                          .show();
              }
          }
      });
  
  public void sendPostRequest(Map&lt;String, String&gt; params) {
      showDialog();
      RequestQueue queue = Volley.newRequestQueue(this);
      String url = "http://www.chris-chris.webege.com/login.php";
  
      mCustomRequest = new CustomRequest(Request.Method.POST,
              url, params, new Response.Listener&lt;JSONObject&gt;() {
          @Override
          public void onResponse(JSONObject response) {
              Intent intent = new Intent(Login.this,
                      Coba.class);
              startActivity(intent);
              finish();
          }
      }, new Response.ErrorListener() {
          @Override
          public void onErrorResponse(VolleyError error) {
              Log.d("Error", error.getMessage());
              hidepDialog();
              Toast.makeText(Login.this, "Belum Terhubung Internet! ", Toast.LENGTH_SHORT).show();
          }
      });
      mCustomRequest.setRetryPolicy(new DefaultRetryPolicy(Template.VolleyRetryPolicy.SOCKET_TIMEOUT,
              Template.VolleyRetryPolicy.RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
      queue.add(mCustomRequest);
  }
  </code></pre>