I am using a RemoteViewsFactory to populate a listview in a widget.
The widget contains a Images. What is the best approach to load the bitmaps and setImageView() on the remote view?
Many thanks.
I am using a RemoteViewsFactory to populate a listview in a widget.
The widget contains a Images. What is the best approach to load the bitmaps and setImageView() on the remote view?
Many thanks.
The way to load images synchronously (works for 'loadImage(...)' and displayImage(...)
):
final Object lock = new Object();
boolean loaded = false;
ImageSize targetImageSize = new ImageSize(70, 70);
ImageLoader.getInstance().loadImage(imageUri, targetImageSize, options, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
loaded = true;
// Do whatever you want with loadedImage
synchronize(lock) {
lock.notifyAll();
}
}
});
if (!loaded) {
synchronize(lock) {
lock.wait();
}
}