解决方法
Roster roster = xmppConnection.getRoster(); Collection<RosterEntry> entries = roster.getEntries(); Presence presence; for(RosterEntry entry : entries) { presence = roster.getPresence(entry.getUser()); System.out.println(entry.getUser()); System.out.println(presence.getType().name()); System.out.println(presence.getStatus()); }