0
我能够加载使用此代码来回回火力地堡存储图片:的Android UI火力地堡图像加载不工作
StorageReference storageRef = storage.getReference().child("Users/" +userId +".jpg");
final long ONE_MEGABYTE = 1024 * 1024;
storageRef.getBytes(ONE_MEGABYTE).addOnSuccessListener(new OnSuccessListener<byte[]>() {
@Override
public void onSuccess(byte[] bytes) {
Log.d(TAG, "downloadImageFromServer onSuccess: ");
Glide.with(UserActivity.this).load(bitmap).asBitmap().into((ImageView) findViewById(R.id.user_photo));
}
}).addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception exception) {
Log.e(TAG, "downloadImageFromServer onFailure() called with: exception = [" + exception + "]");
}
});
但不使用此代码:
final StorageReference storageReference = storage.getReference().child("Users/" +userId +".jpg");
Glide.with(UserActivity.this).using(new FirebaseImageLoader()).load(storageReference).into((ImageView) findViewById(R.id.user_photo));
无论是从documentation取而第二个似乎更方便。
在日志中似乎没有错误。
有人能解释一下这个区别吗?
This是我对这个主题的唯一其他问题,但它没有答案。
我使用com.google.firebase:firebase-storage:10.2.6
和com.firebaseui:firebase-ui-storage:1.2.0
我已经看到,一个人在firebase存储版本有问题。你可以尝试将它降级到10.2.1并检查它是否有效吗? – cristianorbs
谢谢,它的作品。 –