2014-12-08 75 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()); 
 
       } 
 
      }