我有一个存储照片路径的数据库。 在我的应用程序中,我用Glide库显示了这张照片。
路径是:
http://www.mysite.example/username/0.jpg
http://www.mysite.example/username/1.jpg
但是当我删除数据库表格上的行时,我有一个问题,照片的路径从0
重新开始,当我用Glide显示照片时,它会显示之前存储的照片。< / p>
如何解决此问题?清除缓存?
这是代码的片段
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
ImageView imageView;
if (v == null) {
v = inflater.inflate(R.layout.gridview_item, parent, false);
v.setTag(R.id.picture, v.findViewById(R.id.picture));
}
imageView = (ImageView) v.getTag(R.id.picture);
Glide.with(context).load(path.get(position).getPath()).into(imageView);
return v;
}
答案 0 :(得分:0)
最好在服务器端为您的图像名称使用哈希名称。所以网址几乎永远不会相同。