android - 使用 asmack 设置状态不可用

标签 android smack asmack

我正在使用 openfire 和 asmack lib。我正在 Android 聊天应用程序中实现在线离线按钮。如何将我的状态设置为“不可用”。

注意:我不想使用 connection.disconnect() 方法,因为 **

This method cleans up all resources used by the connection. Therefore, the roster, listeners and other stateful objects cannot be re-used by simply calling connect() on this connection again. This is unlike the behavior during unexpected disconnects (and subsequent connections). In that case, all state is preserved to allow for more seamless error recovery.

**

但是当我单击在线按钮时,我需要重用花名册和听众。那我该怎么办。

最佳答案

您可以发送不可用的状态。它是:new Presence(Type.unavaiable);我为我工作

关于android - 使用 asmack 设置状态不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17939973/

相关文章:

android - 无法保持来自粘性服务 android 的持久 XMPP 连接

android - 如何使用 Smack 了解 XMPP openfire 中的键入状态

android - Asmack中的注册方法

java - 使用 smack API 发送和接收消息

java - 在带有 aSmack 的 XMPP 中使用 UserSearch 时,getSearchForm 返回 null

android - 检测用户写了关于应用程序的评论

android - 如何将 youtube playerview 与 scrollview 一起使用?

android - 如何在 Android 手机上创建用户可访问的文件?

java - Android ListView 根据页脚大小将内容包装到一定大小