【发布时间】:2020-10-04 00:19:37
【问题描述】:
几个小时以来,我一直在尝试从 Firebase 存储中检索和设置图像,但我似乎无法获得它。
我已经尝试使用 Bitmap 和 setImageBitmap(),但是当我加载 Activity 时我的应用程序崩溃了。
我也尝试过使用 Glide。还会使我的活动崩溃。我尝试使用不同的图像,认为这可能是原因,但仍然崩溃。
我当前的代码是:
mStorageReference = FirebaseStorage.getInstance().getReference().child(photoUrl);
mStorageReference.getDownloadUrl();
Glide.with(this).load(mStorageReference).into(phProfilePhoto);
使用依赖项:
implementation 'com.github.bumptech.glide:glide:4.11.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'com.firebaseui:firebase-ui-storage:6.3.0'
【问题讨论】:
标签: java android firebase firebase-storage