title: Volley.newRequestQueue() not working
body: <p>I am trying to create an Android-based news app. This news app requests for a JSON object that has an array of JSON objects, each object representing a news article. I am using Volley library for performing these requests.</p>
  
  <p>I created a ContextHelper class to statically obtain Application Context for various uses in this way:-</p>
  
  <pre><code>public class ContextHelper {
  public static Context ctxForAll;
  
  public static void setCtxForAll(Context context){
      ctxForAll=context;
  }}
  </code></pre>
  
  <p>Then I called the constructor from MainActivity like`
   ContextHelper.setCtxForAll(getApplicationContext());</p>
  
  <p>Now I passed this context in the Volley.newRequestQueue()method.
  public class NWReqUtility {</p>
  
  <pre><code>private static String TAG = NWReqUtility.class.getName();
  
  private static NWReqUtility ourInstance;
  private RequestQueue mRequestQueue;
  private static Context mContext;
  
  public static synchronized NWReqUtility getInstance() {
      if (ourInstance==null){
          ourInstance = new NWReqUtility();
      }
      return ourInstance;
  }
  
  private NWReqUtility() {
      mContext = ContextHelper.ctxForAll;
      mRequestQueue = getRequestQueue();
  
  }
  
  public RequestQueue getRequestQueue() {
      if (mRequestQueue==null){
          mRequestQueue = Volley.newRequestQueue(mContext);
      }
      return mRequestQueue;
  }
  public &lt;T&gt; void addToRequestQueue(Request&lt;T&gt; req){
      getRequestQueue().add(req);
  }
  
  public void cancel(){
      mRequestQueue.cancelAll(TAG);
  }}
  </code></pre>
  
  <p>But when I run the app, I found out that the Request was not successful.
  On further going through the code, I found that the line</p>
  
  <pre><code>Volley.newRequestQueue(mContext);
  </code></pre>
  
  <p>is giving the problem.</p>
  
  <p>Why is this issue occurring? Any help will be appreciated.</p>