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.
我显然在Android BEEM中使用smack制作了一个聊天应用程序......我面临的问题是,当我的第一个用户登录并设置他的状态/存在时,登录时其他用户的状态将持续存在......我的用户状态就像 BEEM 一样存储在共享首选项文件中
这就是为什么我想获取我当前登录用户的状态,以便在其他用户登录时不会使用它......所以每次用户登录时状态总是新的......
你不能。Smack 不会为您管理/记住用户的存在。它只管理您收到的存在(例如,来自公鸡中 JID 的存在)。
最简单的方法是创建对上次发送 Presence 的引用,并在每次发送新 Presence 时更新该引用。