Home How to get the current user profile image and name from Firebase?
Reply: 0

How to get the current user profile image and name from Firebase?

user1030
1#
user1030 Published in July 22, 2018, 8:36 am

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);
}
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.312315 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO