Browse SDKs · Android
Platform
SDKsAndroid

Get joined group list

Paginate the list of groups joined by the authenticated user using getJoinedGroupListPage().

Copy

Paginate the list of all groups that the authenticated user has joined. Specify an offset and count to fetch pages iteratively for contacts lists, group pickers, or directory screens.

Code example

int offset = 0;
int count = 20;

OpenIMClient.getInstance().groupManager.getJoinedGroupListPage(
    new OnBase<List<GroupInfo>>() {
        @Override
        public void onSuccess(List<GroupInfo> groups) {
            // groups contains the current page of joined groups
        }

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

Parameters

ParameterTypeRequiredDescription
baseOnBase<List<GroupInfo>>YesCallback delivering the asynchronous operation result.
offsetintYesZero-based paging offset; pass 0 for the initial page.
countintYesMaximum number of group records to fetch in this page.

Return value

The successful callback returns the current page as List<GroupInfo>. Core properties of each group record include:

FieldDescription
groupIDUnique global group ID.
groupNameDisplay name of the group.
faceURLAvatar URL of the group.
memberCountTotal member count in the group.
ownerUserIDUser ID of the group owner.
statusGroup lifecycle status (0 for active, 1 for banned, 2 for dismissed).

Deduplicate and merge group entries in your local cache using groupID. Subsequent joins or exits trigger onJoinedGroupAdded and onJoinedGroupDeleted events via OnGroupListener. For complete listener registration details, see Group overview.