Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想检测聊天中是否存在特定用户:
Presence presence = roster.getPresence(xxxx@xxx.xx); System.out.println("Status receiver :" +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() );