If you are using Glide v4
private BaseTarget target = new BaseTarget<BitmapDrawable>() {
@Override
public void onResourceReady(BitmapDrawable bitmap, Transition<? super BitmapDrawable> transition) {
}
@Override
public void getSize(SizeReadyCallback cb) {
cb.onSizeReady(100, 100);
}
@Override
public void removeCallback(SizeReadyCallback cb) {}
};
and after
Glide.with(activityReference.get().getApplicationContext())
.load(url of image)
.apply(new RequestOptions()
.placeholder(R.mipmap.img)
.error(R.mipmap.img)
.diskCacheStrategy(DiskCacheStrategy.ALL))
.apply(circleCropTransform())
.into(target);
if you have the warning "Unchecked method ..." add before method @SuppressWarnings ("unchecked")
source
share