在 WebView Android 中缓存图像


caching images in webview android

我有一个WebView应用程序,我想删除其上的图像缓存。我尝试在每个图像之后放置"?123456789",以破坏缓存,但它不起作用。你能帮我吗?

if($passed[$i] == 1) {echo "<div class='"contenitoreeventi'">
           <form method='get' action='paginaevento.php'>
          <input type='submit' 
          style='background-image: url(../fotoluoghi/$foto[$i].png?12345689);' 
          class='fotoevento' 
          name='idfesta' 
          value='$idfesta[$i]'/>
           </form>
            ";

您需要添加一些会针对图像的每个请求而更改的内容,例如时间戳。仅使用 ?123456689 不会停止缓存,如果它为后续调用生成相同的 URL。

我通常使用格式为"yyyyMMddHHmmss"的时间戳