Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何在Android中清除url的截取缓存_Java_Android_Android Volley_Lru - Fatal编程技术网

Java 如何在Android中清除url的截取缓存

Java 如何在Android中清除url的截取缓存,java,android,android-volley,lru,Java,Android,Android Volley,Lru,大家好,我碰巧有一个项目,在这个项目中我使用了截击库。然后我发现,在截取从url获得响应后,我倾向于缓存它。所以我现在只想清除特定url的缓存 我试过这个: AppController.getInstance().getRequestQueue().getCache().remove(url); 还有: AppController.getInstance().getRequestQueue().getCache().invalidate(url, true); 我得到了这个答

大家好,我碰巧有一个项目,在这个项目中我使用了截击库。然后我发现,在截取从url获得响应后,我倾向于缓存它。所以我现在只想清除特定url的缓存

我试过这个:

    AppController.getInstance().getRequestQueue().getCache().remove(url);
还有:

    AppController.getInstance().getRequestQueue().getCache().invalidate(url, true);
我得到了这个答案


谢谢你的反对意见。

可能的副本看起来是正确的,但看看这里如何设置它--@Nick Fortescue。。。。。我试过了,但还不清楚具体的原因url@Coded菲尼克斯:在这种情况下,请澄清您的答案,确切说明您所做的事情。我尝试了以上两种方法,但都没有清除缓存。我知道这是因为。。。(例如我查看了调试器,或者我监控了网络活动)我尝试了这两种方法,但都没有效果。我检查了logcat是否有任何错误,但在使用时没有发现任何错误:AppInstance.getInstance().getRequestQueue().getCache().clear();它清除了所有的缓存。我想要的是清除一个特定的url