FirebaseImageLoader doesn't download image

梦想与她 提交于 2019-12-06 06:09:04

问题


I'm trying to download image from storage inside of ViewHolder, but it doesn't work:

FirebaseStorage storage = FirebaseStorage.getInstance();
StorageReference storageReference = storage.getReference();
StorageReference imgRef = storageReference.child("11325404_436219506581300_875224883_a.jpg");
Glide.with(context)
                .using(new FirebaseImageLoader())
                .load(imgRef)
                .into(imageView);

When I use uri instead of FirebaseImageLoader everything works fine:

Glide.with(context)
                .load(uri)
                .centerCrop()
                .into(imageView)

What could be a reason for that?

Update: I've tried to add this code and it shows me right links to images in storage

storageReference.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
            @Override
            public void onSuccess(Uri uri) {
                Log.v(TAG, String.valueOf(uri));
            }
        }).addOnFailureListener(new OnFailureListener() {
            @Override
            public void onFailure(@NonNull Exception exception) {
                // Handle any errors
            }
        });

来源:https://stackoverflow.com/questions/43829591/firebaseimageloader-doesnt-download-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!