Browse SDKs · Android
SDKsAndroid

Transfer group ownership

Use the Android SDK to transfer group ownership to a specified member.

Copy

transferGroupOwner() accepts two parameters: groupID, the ID of the group whose ownership is being transferred, and newOwnerUserID, the ID of the new owner. The target user must already be a member of the group.

OpenIMClient.getInstance().groupManager.transferGroupOwner(new OnBase<String>() {
    @Override public void onSuccess(String data) { /* The request completed. */ }
    @Override public void onError(int code, String error) { /* code and error describe the failure. */ }
}, groupID, newOwnerUserID);

A successful callback means that the transfer request completed. The previous and new owners can produce separate onGroupMemberInfoChanged events; each provides an updated GroupMembersInfo. Merge them by groupID:userID. See Group overview for the complete listener setup, and retrieve the group owner and administrators again when displaying the current management list.