this is my code so far.
public void getimage() {
FirebaseStorage storagi = FirebaseStorage.getInstance();
StorageReference imagerefi = storagi.getReference();
userimage = (ImageView) findViewById(R.id.imageViewuser);
StorageReference pathReference = imagerefi.child("images/"+somename);
imagerefi.child("images/"+somename).getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
@Override
public void onSuccess(Uri uri) {
// Got the download URL for 'users/me/profile.png'
uri2 = uri.toString();
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
// Handle any errors
}
});
Glide.with(this).asDrawable().apply(fitCenterTransform()).load(uri2).into(userimage);
}
I have tried without the success listener, and many other things. When i simply copy-paste the url from the firebase console, i get the image working perfectly. but the uri2 doesnt work as intended.
I basically want to get the file that is named after a firebase user uid and inside a folder called images inside the root directory of firebase storage, and display it on an imageview.
Thanks a lot for any help! I have been trying for weeks to solve this issue.
//some of the code has been recently modified from a stactoverflow post //therefore does nothing in this current configuration, i am aware of that