Smack android名单并不令人耳目一新

时间:2016-03-24 21:05:19

标签: android xmpp openfire smack

1.6我试图找到连接的用户列表它工作正常但它总是在他们离线时显示相同的用户列表。我的意思是即使我重新安装应用程序它仍然显示相同的用户,即使它们都没有连接,列表也不会令人耳目一新

这是我的代码,谢谢

Roster roster = Roster.getInstanceFor(connection);

            if (!roster.isLoaded())
                try { Log.e("Waiting========>", "starts");
                    roster.reloadAndWait();

                } catch (SmackException.NotLoggedInException e) {
                    e.printStackTrace();
                } catch (SmackException.NotConnectedException e) {
                    e.printStackTrace();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            Log.e("Waiting========>", "stops");
            roster.setDefaultSubscriptionMode(Roster.SubscriptionMode.manual);
            Collection<RosterEntry> entries = roster.getEntries();
            for (RosterEntry entry : entries) {
                Log.e("Entry=======>", entry.getUser().toString());
              //  destination=entry.toString();


            } 

0 个答案:

没有答案
相关问题