【发布时间】:2021-08-11 11:34:45
【问题描述】:
所以我正在开发记忆 Firebase 应用程序,并且有一个阶段,用户可以将照片上传到他的记忆中。每张照片都有唯一的名称“ImgLink0”、“ImgLink1”等。
我正在处理的功能是在长按时删除特定照片,但我无法在 Firebase 中访问该图像。
我尝试如下,但因为无法识别图像密钥而卡住了:
mDatabase.child(userUID).child("Memories").child(memoryName).child("Images").addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot) {
for (DataSnapshot imageSnapshot : dataSnapshot.getChildren()) {
String imagesKey = imageSnapshot.getKey();
String imagesValue = (String) imageSnapshot.getValue();
Log.e("Test","" + imagesKey + "" + imagesValue);
}
}
@Override
public void onCancelled(@NonNull DatabaseError databaseError) {
}
});
我也尝试过使用查询,但没有成功,因为我没有图像密钥。
感谢您的帮助:)
【问题讨论】:
标签: java android firebase firebase-realtime-database