Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/221.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何在xmpp中获得会议成员?_Android_Xmpp_Chat - Fatal编程技术网

Android 如何在xmpp中获得会议成员?

Android 如何在xmpp中获得会议成员?,android,xmpp,chat,Android,Xmpp,Chat,我已经从github下载了yaxim源代码,现在我想获得 会议上,我尝试了下面的代码,但它不起作用 但是roomUsers count返回0 如果有人知道从会议室获取用户列表的其他方法,请告诉我您需要加入MUC才能查看其成员。Hi Flow,我在加入会议室后编写了上述代码 String room = "test@conference.abc"; Connection xmppConnection; ConnectionThread connectionThread = Acco

我已经从github下载了yaxim源代码,现在我想获得 会议上,我尝试了下面的代码,但它不起作用

但是roomUsers count返回0


如果有人知道从会议室获取用户列表的其他方法,请告诉我

您需要加入MUC才能查看其成员。

Hi Flow,我在加入会议室后编写了上述代码
String room  = "test@conference.abc";
Connection xmppConnection;
        ConnectionThread connectionThread = AccountManager.getInstance()
                .getAccount(account).getConnectionThread();
        if (connectionThread == null) {
            Application.getInstance().onError(R.string.NOT_CONNECTED);
            return true;
        }
        xmppConnection = connectionThread.getXMPPConnection();
MultiUserChat userChat = new MultiUserChat(xmppConnection, room);
Iterator<String> roomUsers  = userChat.getOccupants();
        System.out.println("roomUsers count === "+userChat.getOccupantsCount());
        while (roomUsers.hasNext()) {
            String roomOccupants = (String) roomUsers.next();
            System.out.println("room users ==== "+roomOccupants);
        }