在聊天中获取接收者用户的状态

时间:2013-11-10 02:27:08

标签: android chat smack asmack quickblox

我想在聊天中检测到特定用户的存在:

Presence presence = roster.getPresence(xxxx@xxx.xx);
System.out.println("Status receiver :" +presence);

如何将presence变量转换为String?我该如何验证价值? (即"可用" /"不可用")。

1 个答案:

答案 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() );