Why I can't change user image on Android project

180 Views Asked by At

I am trying to create a android chat app for college and I am learning from chat21, which has an chat sdk project and chat demo app, and I'm basing my app from these 2 projects and everything works except changing user profile picture from that icon to a image from phone, so could anyone know why...

......................................................................................................

Here is the acticvity_public_profile.xml located on chat21 sdk

Here is the PublicProfileActivity.java located on chat21 sdk

......................................................................................................

Here is the fragment_user_profile.xml located on chat21 demo app

Here is the UserProfileFragment.java located on chat21 demo app

......................................................................................................

1

There are 1 best solutions below

1
On

In the demo project, user data will be stored in contacts node in firebase database. Like this :

enter image description here

Here, you can see that there is no value stored in imageurl. so you will not get any image in profile section.

In your custom project, you can change it and pass firebaseauth.getcurrentuser().getprofilepicurl() to fetch the user profile pic url.