title: Android - cancel Volley request
body: <p>I am using Android Volley lib in my project to execute network requests, all works very well but I have some troubles with the "cancel" feature of this lib. I explain my issue..</p>
  
  <p>I've an activity, where I'm executing the request at <code>OnCreate</code> method, the request is called, no problem. But to be sure that the <code>cancel</code> method works, I wanted to test and try 2 things :  </p>
  
  <ol>
  <li><p>I fire my request and just after cancel it like this : </p>
  
  <p><code>MySingleton.getMyData("urltocall", getDataListener, requestTag);</code>
  <code>MySingleton.getRequestQueue().cancelAll(requestTag);</code></p></li>
  </ol>
  
  <p>This one works! The cancel is called (I can see it too in the Request class of Volley) : </p>
  
  <pre><code>public void cancel() {
          mCanceled = true; // my breakpoint is called here
      }
  </code></pre>
  
  <ol start="2">
  <li><p>I fire my request and just after call finish() method of my activity and in <code>onDestroy</code> and/or <code>onStop</code> method of the activity, I'm calling the same code :</p>
  
  <p><code>MySingleton.getMyData("urltocall", getDataListener, requestTag);</code>
  <code>MySingleton.getRequestQueue().cancelAll(requestTag);</code></p></li>
  </ol>
  
  <p>But this <strong>doesn't work</strong>! </p>
  
  <p>The requestTag is not null and well passed to Volley, so I can't understand why the first method works but not the other one... Knowing that my purpose is to cancel request when <code>onDestroy</code> is called..</p>
  
  <p>Thanks for your help</p>