How can I do this using Glide? I want to cache
image to use it another time also. Thanks in advance.
Currently, at version Glide version 4.9.0, you can set a background for Relative Layout as:-
Glide.with(MainActivity.this)
.load(IMAGE_URL)
.into(new CustomTarget() {
@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
@Override
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition super Drawable> transition) {
mLinearLayout.setBackground(resource);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {
}
});