0

我想检测聊天中是否存在特定用户:

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

如何将存在变量转换为字符串?如何验证价值?(即“可用”/“不可用”)。

4

1 回答 1

0

在此处查看存在文档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() );
于 2013-11-16T08:53:56.133 回答