**从毕加索库中检索图像后,我的活动类似于共享图像文件。我的图像已成功上传到Firebase存储中,并且还成功地将我的图像从Firebase存储中检索到了实时数据库中,但无法能够将图像从实时数据库检索到我的应用,以显示正在使用该应用的用户。 除了导入和公共类,我上面已经编写了整个Java活动代码
[![@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_settings);
mAuth = FirebaseAuth.getInstance();
currentUserID = mAuth.getCurrentUser().getUid();
RootRef = FirebaseDatabase.getInstance().getReference();
UserProfileImageRef = FirebaseStorage.getInstance().getReference().child("Profile Images");
InitializeFields(); //Initialize fields
RetrieveUserInfo();
//User profile image set on click listener
UserProfileImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view)
{
Intent gallaryIntent = new Intent();
gallaryIntent.setAction(Intent.ACTION_GET_CONTENT);
gallaryIntent.setType("image/*");
startActivityForResult(gallaryIntent, GallaryPick);
}
});
RootRef.child("Users").child(currentUserID)
.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(@NonNull DataSnapshot dataSnapshot)
{
String retrieveProfileImage = dataSnapshot.child("image").getValue().toString();
Picasso.get().load(retrieveProfileImage).into(UserProfileImage);
})*;][1]][1]