# User profile pic not displaying in the recent chat list screen

**URL:** https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531
**Category:** Android
**Created:** [September 22, 2022, 9:20am UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531 "2022-09-22T09:20:09Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![IMKalpataru](https://avatars.discourse-cdn.com/v4/letter/i/e56c9b/32.png) [@IMKalpataru](https://forum.social.plus/u/IMKalpataru)
#### Post date: [September 22, 2022, 9:20am UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531/1 "2022-09-22T09:20:09Z")

</div>

@SocialPlus_Support In my recent chat list screen ,the user profile pic is not displaying .After analyse the code in recent chat list screen we are using "AmityChannel "model to display the list of recent chats but in AmityChannel the avatar is always null even-though the user having profile pic its getting null . Avatar attribute is not updating in AmityChannel.Could you please confirm the same.

---

<div class="post-metadata">

### Author: ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)
#### Post date: [September 22, 2022, 11:36am UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531/2 "2022-09-22T11:36:25Z")

</div>

Hi @IMKalpataru for user profile, please get the avatar from user’s avatar instead of channel’s avatar. Please see code example in this user section [User - Amity Docs](https://docs.amity.co/core-concepts/user)

---

<div class="post-metadata">

### Author: ![IMKalpataru](https://avatars.discourse-cdn.com/v4/letter/i/e56c9b/32.png) [@IMKalpataru](https://forum.social.plus/u/IMKalpataru)
#### Post date: [September 22, 2022, 11:48am UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531/3 "2022-09-22T11:48:31Z")

</div>

Hi @SocialPlus_Support ,here is the code for getting user right  
fun getUser(userRepository: AmityUserRepository) {  
userRepository.getUser(userId = “brian3291”)  
.doOnNext { user: AmityUser →   
val displayname = user.getDisplayName()  
}  
.subscribe()  
}

---

<div class="post-metadata">

### Author: ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)
#### Post date: [September 22, 2022, 11:55am UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531/4 "2022-09-22T11:55:40Z")

</div>

Yes, that’s correct.

---

<div class="post-metadata">

### Author: ![IMKalpataru](https://avatars.discourse-cdn.com/v4/letter/i/e56c9b/32.png) [@IMKalpataru](https://forum.social.plus/u/IMKalpataru)
#### Post date: [September 23, 2022, 6:43am UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531/5 "2022-09-23T06:43:18Z")

</div>

Hi @SocialPlus_Support in the above code, we need to pass userId to get userdetails but in AmityChannel we doesn’t have userId attribute . Instead of userId AmityChannel having displayname . Can we proceed with searchUserByDisplayName(“displayname”) function

---

<div class="post-metadata">

### Author: ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)
#### Post date: [September 23, 2022, 8:03am UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531/6 "2022-09-23T08:03:29Z")

</div>

Hello, to get users in a channel, please use follow this sample:

`channel.membership().getMembers().build().query().subscribe {}`

---

<div class="post-metadata">

### Author: ![Sangeetha](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@Sangeetha](https://forum.social.plus/u/Sangeetha)
#### Post date: [October 11, 2022, 9:41am UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531/7 "2022-10-11T09:41:27Z")

</div>

Hi @SocialPlus_Support i have tried below query to get channel user’s using channel Id in chat screen. here  
I am not getting any response list .Can you please guide us is that proper way to get members list.

@OptIn(ExperimentalPagingApi::class)  
fun getMembers(onResult: (list: PagedList) → Unit): Completable {  
val channelRepository: AmityChannelRepository = AmityChatClient.newChannelRepository()  
return channelRepository.membership(channelId).getMembers()  
.build()  
.query()  
.throttleLatest(1, TimeUnit.SECONDS, true)  
.subscribeOn([Schedulers.io](http://Schedulers.io)())  
.observeOn(AndroidSchedulers.mainThread())  
.doOnNext {  
onResult.invoke(it)  
}  
.ignoreElements()  
}  
}

---

<div class="post-metadata">

### Author: ![naphat](https://avatars.discourse-cdn.com/v4/letter/n/dbc845/32.png) [@naphat](https://forum.social.plus/u/naphat)
#### Post date: [October 12, 2022, 8:29am UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531/8 "2022-10-12T08:29:11Z")

</div>

Hi @Sangeetha can you try the code like this and let see anything response to you.

val channelRepository: AmityChannelRepository = AmityChatClient.newChannelRepository()  
channelRepository.membership(“ChannelId”)  
.getMembers()  
.build()  
.query()  
.throttleLatest(1, TimeUnit.SECONDS, true)  
.subscribeOn([Schedulers.io](http://Schedulers.io)())  
.observeOn(AndroidSchedulers.mainThread())  
.doOnNext {  
Log.e(“pagedlist”, it.toString())  
}  
.ignoreElements()  
.subscribe()

---

<div class="post-metadata">

### Author: ![Sangeetha](https://avatars.discourse-cdn.com/v4/letter/s/8baadc/32.png) [@Sangeetha](https://forum.social.plus/u/Sangeetha)
#### Post date: [October 12, 2022, 11:40am UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531/9 "2022-10-12T11:40:38Z")

</div>

Hi @naphat still i am getting empty list in doOnNext . here i have to get list of user for single channel does above function will return as list .Could you please guide us

 ![Screenshot 2022-10-12 at 4.42.29 PM](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/1c238a66ae771974d84def0b0c80e6678c412a85.jpeg)

---

<div class="post-metadata">

### Author: ![naphat](https://avatars.discourse-cdn.com/v4/letter/n/dbc845/32.png) [@naphat](https://forum.social.plus/u/naphat)
#### Post date: [October 17, 2022, 12:57pm UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531/10 "2022-10-17T12:57:21Z")

</div>

Hi @Sangeetha sorry for my late reply. I just tried different scenario and one thing I found is if the channel ID is not exist it will always return so  
can you check the error log is there anything like this ?

```auto
 E/com.ekoapp.ekosdk.internal.util.RxEko: LOG_ERROR_CONSUMER: message: The exception was not handled due to missing onError handler in the subscribe() method call. Further reading: https://github.com/ReactiveX/RxJava/wiki/Error-Handling | com.amity.socialcloud.sdk.core.error.AmityException: ChannelId Not Found

```

---

<div class="post-metadata">

### Author: ![IMKalpataru](https://avatars.discourse-cdn.com/v4/letter/i/e56c9b/32.png) [@IMKalpataru](https://forum.social.plus/u/IMKalpataru)
#### Post date: [October 18, 2022, 10:46am UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531/11 "2022-10-18T10:46:52Z")

</div>

Hi @naphat I am taking channelId from AmityChannel and passing that same channelId to getmembers() , so I am not getting any AmityException . Actually when I try with 5.23.0 version I can able to get list of AmityChannelMember but after upgrade the version to 5.27.1 and 5.28 I am getting empty list . Please guide us.  
This is the function to get AmityChannelMember:

fun getMembers(channelID : String):Flowable\<PagedList\> {  
return AmityChatClient.newChannelRepository().  
membership(channelID).getMembers().build().query()  
}  
Below are the screenshots for both versions :

 ![Version 5.23.0](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/32b1204de111721c884d6680567d6cd411563dde.jpeg)

 ![Version 5.27.1](https://europe1.discourse-cdn.com/flex013/uploads/amity/original/1X/c2f08e0d0317c57623ea4f101d1d683c25008a69.jpeg)

---

<div class="post-metadata">

### Author: ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)
#### Post date: [October 18, 2022, 11:20am UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531/12 "2022-10-18T11:20:40Z")

</div>

Hello @IMKalpataru Naphat is one of our team members, we cannot reproduce this on our end. Would you mind sending us your apikey and channelId to our support email please? [support.asc@amity.co](mailto:support.asc@amity.co) and we will do further check from there.

---

<div class="post-metadata">

### Author: ![IMKalpataru](https://avatars.discourse-cdn.com/v4/letter/i/e56c9b/32.png) [@IMKalpataru](https://forum.social.plus/u/IMKalpataru)
#### Post date: [October 18, 2022, 12:04pm UTC](https://forum.social.plus/t/user-profile-pic-not-displaying-in-the-recent-chat-list-screen/531/13 "2022-10-18T12:04:38Z")

</div>

hi @SocialPlus_Support we have shared the apikey and channelID over mail. Please check.
