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
謝謝,它的作品。 –