title: 1st time not getting response from the sever android volley
body: <p>Code in java class:</p>
  
  <pre><code>public String POST(String url, final Map&lt;String, String&gt; params, final VolleyCallBack callBack) {
  
          //RequestFuture&lt;String&gt; requestFuture = new RequestFuture.newFuture();
          RequestFuture&lt;String&gt; future = RequestFuture.newFuture();
          progressDialog = new ProgressDialog(context);
          progressDialog.setMessage("Loading....");
          progressDialog.show();
          StringRequest stringRequest = new StringRequest(
                  Request.Method.POST,
                  url,
  
                  new Response.Listener&lt;String&gt;() {
                      @Override
                      public void onResponse(String response) {
                          try {
                              JSONObject jsonObject = new JSONObject(response);
                              progressDialog.dismiss();
  
                              val = jsonObject.getString("message");
                              callBack.onSuccess();
                          } catch (JSONException e) {
                              e.printStackTrace();
                          }
                      }
                  }, new Response.ErrorListener() {
              @Override
              public void onErrorResponse(VolleyError error) {
                  progressDialog.dismiss();
                  ToastMsg(error.getMessage() + " " + error.getStackTrace()[0]);
              }
          }
          ) {
              @Override
              protected Map&lt;String, String&gt; getParams() {
                  return params;
              }
          };
  
          RetryPolicy mRetryPolicy = new DefaultRetryPolicy(
                  0,
                  DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
                  DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
          stringRequest.setRetryPolicy(mRetryPolicy);
  
          RequestQueue requestQueue = Volley.newRequestQueue(context);
          stringRequest.setShouldCache(false);
          requestQueue.add(stringRequest);
  
  
          return val;
      }
  </code></pre>
  
  <p><strong>Code in Activity Class:</strong></p>
  
  <pre><code>val = db.POST(Constants.URL_FacultyLogin, map);
  </code></pre>
  
  <p>For the 1st time when I click on the button I'm not getting a response from the server but 2nd I'm getting a response can anyone help me out why not for the 1st time.</p>