2014-12-08 53 views

回答

2

使用用户已加入了房间名称的这让列表:

Iterator roomsJoinedByUser = MultiUserChat.getJoinedRooms(connection, "[email protected]"); 

使用它来获取列表中的所有托管客房:

Collection<HostedRoom> rooms = MultiUserChat.getHostedRooms(connection, "service_name"); 
+0

我需要所有的公共聊天室 – 2014-12-08 09:59:20

+0

检查编辑的答案... – 2014-12-09 08:02:22

1

这里是我的代码希望它有帮助

Collection<HostedRoom> rooms = MultiUserChat.getHostedRooms(connection, "conference.nubes-pc-1"); 
 

 
      if (!rooms.isEmpty()){ 
 
       for (HostedRoom room : rooms) { 
 
        Log.d("yo", room.getName()+" "+ room.getJid()); 
 
       } 
 
      }