title: How to wait for RequestQueue job to finish?
body: <p>I'm trying to create a login page for my app. I check the credentials by doing a get request to a web server which is tied in to my user database.</p>
  
  <pre><code>public boolean checkCredentials(String email, String password) throws JSONException {
  
      // Make a get request to the server
      String url = MyUtils.createLoginUrl(email, password);
  
      JsonObjectRequest jsObjRequest = new JsonObjectRequest
              (Request.Method.GET, url, requestParam, new Response.Listener&lt;JSONObject&gt;() {
  
                  @Override
                  public void onResponse(JSONObject response) {
                      successLogin = response.length() &gt; 0;
                      jsonResponse = response.length() &gt; 0 ? response : null;
                      //requestPending -= 1;
                  }
              }, new Response.ErrorListener() {
  
                  @Override
                  public void onErrorResponse(VolleyError error) {
                      MyUtils.showToast(getBaseContext(), error.getMessage().toString());
                      //requestPending -= 1;
                  }
              });
  
      SingletonRequestQueue.getInstance(this).addToRequestQueue(jsObjRequest);
      //requestPending += 1;
      // I WANT THE JOB TO FINISH BEFORE RETURNING FROM THIS FUNCTION
      return successLogin;
  }
  </code></pre>
  
  <p>Is there a non-blocking way to do this using the Volley library? Google wasn't giving me much info. </p>