IMKit SDK 4.X
会话列表如何过滤会话
-
继承
ConversationListFragment
-
重载
public void onEventMainThread(Message message)
和public boolean shouldFilterConversation(ConversationType type, String targetId)
-
在上面重载的两个方法里面,根据
targteId
过滤会话,参考代码如下
public void onEventMainThread(Message message) {
ConversationType conversationType = message.getConversationType();
String targetId = message.getTargetId();
if (targetId.equals("你想过滤的targetId")){
return;
}else {
super.onEventMainThread(message);
}
public boolean shouldFilterConversation(ConversationType type, String targetId) {
if (targetId.equals("你想过滤的targetId")) return true;
return false;
}
IMKit SDK 5.X
设置对应的数据处理器, 在filtered()回调中处理:
https://doc.rongcloud.cn/im/Android/5.X/ui/conversationlist/dataProcessor