Browse SDKs · Android
Platform
SDKsAndroid

Dismiss a group

Disband a specified group and terminate all member sessions using dismissGroup().

Copy

Disband a specified group as the group owner. Once dismissed, all members are evicted from the group, new messages cannot be sent, and the group cannot be restored.

Code example

String groupID = "group_123";

OpenIMClient.getInstance().groupManager.dismissGroup(
    new OnBase<String>() {
        @Override
        public void onSuccess(String data) {
            // Group dismissed successfully
        }

        @Override
        public void onError(int code, String error) {
            // Handle failure
        }
    },
    groupID
);

Parameters

ParameterTypeRequiredDescription
baseOnBase<String>YesCallback delivering the asynchronous operation result.
groupIDStringYesTarget group ID to dismiss. Only the group owner can execute this action.

Return value

The successful callback confirms that the group dismissal was completed on the server.

State changes after the call

Group members receive the onGroupDismissed(GroupInfo group) event via OnGroupListener. Use groupID to flag the group as dissolved in local storage, disable the message composer in the chat interface, and update the group roster. For complete listener registration details, see Group overview.