The below code is meant to implement glide on a multiple image uploading app. I am trying to set the variable bitmap1 in the onResourceReady and imageView for reuse in the code (upload) without success.
@Override
protected void onActivityResult(int RC, int RQC, Intent I) {
super.onActivityResult(RC, RQC, I);
if (RC == 1 && RQC == RESULT_OK && I != null && I.getData() != null) {
Uri uri = I.getData();
RequestOptions options = new RequestOptions()
.format(DecodeFormat.PREFER_RGB_565)
.placeholder(R.drawable.ic_launcher_background)
.error(R.drawable.ic_launcher_background);
Glide.with(this)
.setDefaultRequestOptions(options)
.load(uri)
.centerInside()
.into(new CustomTarget<Drawable>(512, 512) {
@Override
public void onResourceReady(@NonNull Drawable bitmap1, @Nullable Transition<? super Drawable> transition) {
imageView1.setImageDrawable(bitmap1);
}
@Override
public void onLoadCleared(@Nullable Drawable placeholder) {}
});
}