目前我正在使用 Xmpp SMACK API 工作聊天应用程序。但是当我调用 addrosterListener 时,我没有获得当前状态。我必须参考 http://www.igniterealtime.org/builds/smack/docs/3.2.2 /javadoc/org/jivesoftware/smack/RosterListener.html .请帮帮我。
roster.addRosterListener(new RosterListener() {
@Override
public void presenceChanged(Presence presence) {
Log.d("pewsence ", "pewsence Status: " + presence.getFrom());
Log.d("pewsence ", "pewsence to Status: "
+ presence.getTo() + " " + presence);
// Called when the presence of a roster entry is
// changed
}
@Override
public void entriesUpdated(Collection<String> arg0) {
// Called when a roster entries are updated.
}
@Override
public void entriesDeleted(Collection<String> arg0) {
// Called when a roster entries are removed.
}
@Override
public void entriesAdded(Collection<String> arg0) {
// Called when a roster entries are added.
}
});
}
}
});
创建活动时调用此侦听器。我认为参考所有文档,当存在发生变化时会自动调用此侦听器。
提前致谢。