Android, Picasso, Firebase Storage - Retrieve Imag

2019-03-04 14:24发布

问题:

I already tried using Glide.with(opDetails.this).using(new FirebaseImageLoader()).load(uri).into(imgPhoto1); but had some problems with .using(). I am now trying to use picasso. Althougt the compiler shows no error, no image is displayed to the ImageView and i cant understand why.

    storage = FirebaseStorage.getInstance();
    storageRef = storage.getReference();

    storageRef.child("images/4736af35-608d-4b97-95ba-029ef471c5eb.png").getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
        @Override
        public void onSuccess(Uri uri) {
            Picasso.with(opDetails.this).load(uri).into(imgPhoto1);

        }
    }).addOnFailureListener(new OnFailureListener() {
        @Override
        public void onFailure(@NonNull Exception exception) {

        }
    });
}

Update:

Firebase Storage Image

Storage Rules

Thanks in advance.

回答1:

Try this:-

storageRef.child("images/4736af35-608d-4b97-95ba-029ef471c5eb").getDownloadUrl().addOnSuccessListener....