# How channels are getting listed

**URL:** <https://community.sendbird.com/t/how-channels-are-getting-listed/1990>\
**Category:** Android\
**Created:** [April 1, 2021, 1:02pm UTC](https://community.sendbird.com/t/how-channels-are-getting-listed/1990 "2021-04-01T13:02:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![sakkk](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@sakkk](https://community.sendbird.com/u/sakkk)\
**Post date:** [April 1, 2021, 1:02pm UTC](https://community.sendbird.com/t/how-channels-are-getting-listed/1990/1 "2021-04-01T13:02:36Z")

</div>

Hi, In the android app when I click on the Group channels, I would like to know which method returns this list of channels in custom-uikit-sample code.

---

<div class="post-metadata">

**Author:** ![walter.rodriguez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/walter.rodriguez/32/546_2.png) [@walter.rodriguez](https://community.sendbird.com/u/walter.rodriguez)\
**Post date:** [April 1, 2021, 2:10pm UTC](https://community.sendbird.com/t/how-channels-are-getting-listed/1990/2 "2021-04-01T14:10:14Z")

</div>

Not sure if this is what you refer to but for Android and the **uikit-custom-sample** project, the listing of channels is located in:

**com.sendbird.uikit.customsample.fragments.CustomChannelListFragment.java**

Internally, **onDrawPage()** is performed so, if you override that method and remove the call to **super** , you won’t see the list at all.

 ![Screenshot 2021-04-01 at 15.06.11](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/c/c94773c0465428a10bbd6c849ceadf20958244a2.png)

---

<div class="post-metadata">

**Author:** ![sakkk](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@sakkk](https://community.sendbird.com/u/sakkk)\
**Post date:** [April 1, 2021, 2:28pm UTC](https://community.sendbird.com/t/how-channels-are-getting-listed/1990/3 "2021-04-01T14:28:10Z")

</div>

Actually what I am looking is that…while we list the list of channel I would check the ‘channel member’ metadata to identify my key…so I will get only the workspace related to user channels…hope you got my point…I am looking for a place where I should able to check my channel values and show only required channels all-time while listing the channel

---

<div class="post-metadata">

**Author:** ![sakkk](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@sakkk](https://community.sendbird.com/u/sakkk)\
**Post date:** [April 1, 2021, 4:47pm UTC](https://community.sendbird.com/t/how-channels-are-getting-listed/1990/4 "2021-04-01T16:47:43Z")

</div>

I really need your help to sort out this problem. Please don’t ignore…we were trying to solve this past 3 days and we failed to do it… please help us to understand.

Actually what I am looking is that…while we list the list of channel I would check the ‘channel member’ metadata to identify my key…so I will get only the workspace related to user channels…hope you got my point…I am looking for a place where I should able to check my channel values and show only required channels all-time while listing the channel

---

<div class="post-metadata">

**Author:** ![Doo\_Rim](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/doo_rim/32/239_2.png) [@Doo\_Rim](https://community.sendbird.com/u/Doo_Rim)\
**Post date:** [April 2, 2021, 1:14am UTC](https://community.sendbird.com/t/how-channels-are-getting-listed/1990/5 "2021-04-02T01:14:59Z")

</div>

Hi, @sakkk  
You can controll channel list in `CustomChannelListAdapter`. `ChannelListFragment` set channel list to `CustomChannelListAdapter` internally.

If you want to discriminate channel from channel list,

1. you create your own ViewHolder
2. Override `getItemViewType` and impl this method.
3. Create different ViewHolder depending on viewType in `onCreateViewHolder`.

public class CustomChannelListAdapter extends ChannelListAdapter {

```
@NonNull
@Override
public BaseViewHolder<GroupChannel> onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
    // using viewType to discriminate channel
    return new CustomChannelViewHolder(ViewCustomChannelHolderBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false));
}

@Override
public void onBindViewHolder(@NonNull BaseViewHolder<GroupChannel> holder, int position) {
    super.onBindViewHolder(holder, position);
}

@Override
public int getItemViewType(int position) {
    GroupChannel channel = getItem(position);
    // Discriminate channel and return viewType you intend
    return viewType;
}

```

}

---

<div class="post-metadata">

**Author:** ![sakkk](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@sakkk](https://community.sendbird.com/u/sakkk)\
**Post date:** [April 2, 2021, 9:41am UTC](https://community.sendbird.com/t/how-channels-are-getting-listed/1990/6 "2021-04-02T09:41:28Z")

</div>

Hi.  
I really don’t understand the logic here, can u please help me to write a quick code for my requirement. and which class.  
My requirement is below…  
if the channel message count is greater than 2, then only I wanted to display the channels,.Please help me…this is not the exact requirement but just simplifying it…

---

<div class="post-metadata">

**Author:** ![sakkk](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@sakkk](https://community.sendbird.com/u/sakkk)\
**Post date:** [April 3, 2021, 10:37am UTC](https://community.sendbird.com/t/how-channels-are-getting-listed/1990/7 "2021-04-03T10:37:47Z")

</div>

today after 3 days of long struggle , i have identified where need to put the condition…its just a single line and we no need to do anything like above or which you have mentioned in my previous topic…u could have helped to save my 3 days…anyways thanks for your initial helps …

---

<div class="post-metadata">

**Author:** ![Doo\_Rim](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/doo_rim/32/239_2.png) [@Doo\_Rim](https://community.sendbird.com/u/Doo_Rim)\
**Post date:** [April 4, 2021, 11:22pm UTC](https://community.sendbird.com/t/how-channels-are-getting-listed/1990/8 "2021-04-04T23:22:03Z")

</div>

@sakkk  
I apologize for not being able to give you an exact solution to your requirements. I’m glad you’ve solved it!

---

<div class="post-metadata">

**Author:** ![walter.rodriguez](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/walter.rodriguez/32/546_2.png) [@walter.rodriguez](https://community.sendbird.com/u/walter.rodriguez)\
**Post date:** [April 8, 2021, 11:13am UTC](https://community.sendbird.com/t/how-channels-are-getting-listed/1990/9 "2021-04-08T11:13:20Z")

</div>

@sakkk Can you please post your solution? That will help us to provide a more precise solution. Thanks!
