Below is my Firebase structure image,
Firebase Structure
I will like to use the name and profile image of user for my Second Activity.
Here how I did for my another app,
FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser();
String uid = user.getUid();
String name = user.getDisplayName();
And I later used the name
in my TextView
to use the current user name but here it didn't worked and besides I also needed the profile image too.
So, How do I get the user image and name from above Firebase structure image to my Second activity layout TextView
and ImageView
and set the default text name and image if it returns null.
I tried below but it didn't worked to
public void setUserData(String name, String image) {
ImageView userimage = (ImageView) findViewById(R.id.imageView);
userimage.setImageURI(userimage);
}