title: Volley doesn't work, no return response
body: <p>I used Volley in couple of projects before, all works.  I have a very small sample test project based on the tutorial, it works, but in this project (mostly coded by someone else) when I add Volley to it it doesn't work.  getParams is called, that means the queue is fine, but no response method gets called.  I then intentionally removed the INTERNET permission.  I expected a permission exception in logcat, but it didn't happen.  My log stayed at getParams.  It appeared that after getParams Volley silently died with no error, no return.  Has anyone seen this before?  The code is very simple, pretty much followed the tutorial using new RequestQueue(context) and the same code works everywhere else. All testings are done on the same test device.  </p>
  
  <p>This is the version I used.
  implementation 'com.android.volley:volley:1.1.0'</p>
  
  <pre><code>import android.app.Application;
  import android.content.Context;
  import android.net.Uri;
  import android.util.Log;
  
  import com.android.volley.AuthFailureError;
  import com.android.volley.DefaultRetryPolicy;
  import com.android.volley.Request;
  import com.android.volley.RequestQueue;
  import com.android.volley.Response;
  import com.android.volley.VolleyError;
  import com.android.volley.toolbox.StringRequest;
  import com.android.volley.toolbox.Volley;
  import com.mapswithme.maps.mrf.VolleyCallback;
  
  import java.util.HashMap;
  import java.util.Map;
  
  public class NetRequest {
  
  private static NetRequest myObj;
  
  private RequestQueue mRequestQueue;
  /**
   * Create private constructor
   */
  private NetRequest(){
  
  }
  /**
   * Create a static method to get instance.
   */
  public static NetRequest getInstance(){
      if(myObj == null){
          myObj = new NetRequest();
      }
      return myObj;
  }
  
  public void networkStringRequest(Context context, String url, final Map&lt;String, String&gt; param, final VolleyCallback callback, int timeout_ms, int max_retry, float backoff)
  {
  
      StringRequest strReq = new StringRequest(Request.Method.POST,
              url, new Response.Listener&lt;String&gt;() {
  
          @Override
          public void onResponse(String response) {
              Log.i("test", "Volley returned");
              callback.onSuccess(response);
          }
      }, new Response.ErrorListener() {
  
          @Override
          public void onErrorResponse(VolleyError error) {
              Log.i("test", "Volley error response");
              callback.onFailed(error.toString());
          }
      })
      {
          @Override
          protected Map&lt;String, String&gt; getParams() throws AuthFailureError {
              Log.i("test", "get param");
              if (param == null)
                  return new HashMap&lt;String, String&gt;();
              return param;
          }
      };
  
      strReq.setRetryPolicy(new DefaultRetryPolicy(
              timeout_ms,
              max_retry,
              backoff));
  
  
      if (mRequestQueue==null) {
          //make sure we are using application context
          Context ctx;
          if (context instanceof Application) {
              ctx = context;
          }
          else
              ctx = context.getApplicationContext();
  
  
          Log.i("test", "new request queue");
          mRequestQueue = Volley.newRequestQueue(ctx);
      }
  
      Log.i("test", "add to request queue");
      mRequestQueue.add(strReq);
  }
  
  public void networkStringRequest(Context context, String url, Map&lt;String, String&gt; param, final VolleyCallback callback)
  {
      networkStringRequest(context, url, param, callback, DefaultRetryPolicy.DEFAULT_TIMEOUT_MS, DefaultRetryPolicy.DEFAULT_MAX_RETRIES, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
  }
  
  }
  </code></pre>
  
  <p>In another file:</p>
  
  <pre><code>public interface VolleyCallback {
  
  void onSuccess(String result);
  void onFailed(String result);
  }
  </code></pre>
  
  <p>In mainactivity:</p>
  
  <pre><code> String url = "http://httpbin.org/post";
  HashMap&lt;String, String&gt; param = new HashMap&lt;String, String&gt;();
  param.put("test", "test");
  NetRequest.getInstance().networkStringRequest(getApplicationContext(), url, param, new VolleyCallback() {
    @Override
    public void onSuccess(String result) {
    Log.i("test", "success net");
    }
  
    @Override
    public void onFailed(String result) {
      Log.i("test", "failed net");
    }
  });
  </code></pre>