use of com.cometchat.pro.core.GroupsRequest in project android-java-chat-push-notification-app by cometchat-pro.
the class CometChatGroupList method searchGroup.
/**
* This method is used to search groups present in your App_ID.
* For more detail please visit our official documentation {@link "https://prodocs.cometchat.com/docs/android-groups-retrieve-groups" }
*
* @param s is a string used to get groups matches with this string.
* @see GroupsRequest
*/
private void searchGroup(String s) {
GroupsRequest groupsRequest = new GroupsRequest.GroupsRequestBuilder().setSearchKeyWord(s).setLimit(100).build();
groupsRequest.fetchNext(new CometChat.CallbackListener<List<Group>>() {
@Override
public void onSuccess(List<Group> groups) {
// sets the groups in rvGroupList i.e CometChatGroupList Component.
rvGroupList.searchGroupList(groups);
}
@Override
public void onError(CometChatException e) {
Toast.makeText(getContext(), CometChatError.localized(e), Toast.LENGTH_SHORT).show();
}
});
}
Aggregations