我想在聊天中检测到特定用户的存在:
Presence presence = roster.getPresence(xxxx@xxx.xx);
System.out.println("Status receiver :" +presence);
如何将presence变量转换为String?我该如何验证价值? (即"可用" /"不可用")。
答案 0 :(得分:0)
在此检查Presence文档http://www.igniterealtime.org/builds/smack/docs/latest/javadoc/org/jivesoftware/smack/packet/Presence.html
可能是这样的:
Presence presence = roster.getPresence(xxxx@xxx.xx);
System.out.println("Status receiver :" +presence.getStatus() );