How to load 1 image from server to multiple imageView using Glide? i've try this code :
Glide.with(ViewProductActivity.this)
.load(LoginActivity.SERVER_URL+"/product/asset/"+listImageUrl.getString(i))
.asBitmap()
.placeholder(R.drawable.loading)
.error(R.drawable.noimage)
.signature(new StringSignature(String.valueOf(System.currentTimeMillis())))
.into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap resource, GlideAnimation<? super Bitmap> glideAnimation) {
ivImageChild.setImageBitmap(resource);
ivImageMain.setImageBitmap(resource);
}
});
but the placeholder() doesn't work.. how to solve?
Simply create request for each image :)
Glide.with(ViewProductActivity.this)
.load(LoginActivity.SERVER_URL+"/product/asset/"+listImageUrl.getString(i))
.asBitmap()
.placeholder(R.drawable.loading)
.error(R.drawable.noimage)
.signature(new StringSignature(String.valueOf(System.currentTimeMillis())))
.into(ivImageChild);
Glide.with(ViewProductActivity.this)
.load(LoginActivity.SERVER_URL+"/product/asset/"+listImageUrl.getString(i))
.asBitmap()
.placeholder(R.drawable.loading)
.error(R.drawable.noimage)
.signature(new StringSignature(String.valueOf(System.currentTimeMillis())))
.into(ivImageMain);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With