【发布时间】:2016-12-16 13:08:47
【问题描述】:
您好,我在使用 Picasso 的 appwidget listview 项目中有缩略图。但它在滚动列表视图时显示为正在加载。我使用下面的代码在 RemoteViews getViewAt(int position) 方法中加载图像,
try {
Bitmap b = Picasso.with(context).load(url).get();
remoteView.setImageViewBitmap(R.id.feed_image, b);
} catch (Exception e) {
e.printStackTrace();
}
有没有办法将它存储在缓存中并避免重新加载?请给我一个想法。
【问题讨论】:
-
这里,不需要在imageview设置位图。可以直接使用Picasso或Glide加载URL。
-
@ViramP 你能告诉我怎么做吗?
-
您找到解决方案了吗? @Sangeetha
标签: android android-widget android-appwidget-list