Browse SDKs · Android
Platform
SDKsAndroid

Hide a conversation

Temporarily hide a conversation from the authenticated user conversation list using hideConversation().

Copy

Temporarily hide a conversation entry from the authenticated account's conversation list. This operation collapses the conversation entry without deleting chat history, altering friendships, or leaving groups.

Code example

OpenIMClient.getInstance().conversationManager.hideConversation(
    new OnBase<String>() {
        @Override
        public void onSuccess(String data) {
            // Conversation hidden successfully.
        }

        @Override
        public void onError(int code, String error) {
            // code and error describe the failure.
        }
    },
    conversationID
);

Parameters

ParameterTypeRequiredDescription
baseOnBase<String>YesCallback delivering the asynchronous operation result.
conversationIDStringYesTarget conversation identifier.

Return value

The successful callback indicates that the server recorded the hidden state for the conversation.

State changes after the call

Hiding removes the conversation strictly from the active list presentation. If a new message arrives in this conversation or an incremental synchronization restores it, the SDK automatically brings the conversation back into view. Upon callback success, remove the item matching conversationID from your in-memory list and update the view. For subsequent conversation updates, see Get the conversation list.