2

Hello Guys, I happen to have a project, in which i used the Volley library. I then discovered after volley gets the response from a url i tends to cache it. So all i want now is to clear the cache for the specific url.

I tried this:

    AppController.getInstance().getRequestQueue().getCache().remove(url);

and also this:

    AppController.getInstance().getRequestQueue().getCache().invalidate(url, true);

I got this answer here

Thanks in anticipitation.

Community
  • 1
  • 1
pariola
  • 923
  • 12
  • 27
  • Possible duplicate of [How to clear the volley cache automatically?](http://stackoverflow.com/questions/24464610/how-to-clear-the-volley-cache-automatically) – Nick Fortescue Dec 02 '15 at 15:54
  • that looks correct, but have a look here on how to set it all up -- http://www.androidhive.info/2014/05/android-working-with-volley-library-1/ – Tasos Dec 02 '15 at 15:54
  • @Nick Fortescue ..... I tried that still it doesn't clear for a specific url – pariola Dec 02 '15 at 16:04
  • @Coded Phoenix In that case clarify your answer to say exactly what you did. Eg I tried doing both of the above, and it didn't clear the cache. I know this because ... (eg I looked in a debugger, or I monitored network activity) – Nick Fortescue Dec 02 '15 at 16:12
  • i tried both, all to no avail. i checked the logcat for any errors, I found nothing but when i used: AppInstance.getInstance().getRequestQueue().getCache().clear(); it cleared all the cache. And what i want is to clear for a specific url – pariola Dec 02 '15 at 16:25
  • have you got any solution @Coded Phoenix – Bala Saikrupa Puram Sep 21 '16 at 14:20

0 Answers0