I am using openfire and asmack lib. I am implementing online and offline button in android chat application .How can I set my presence "unavailable".

Note: I don't want to use connection.disconnect() method ,because **

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.

**

But I need to reuse roster and listeners when I click online button. So what should I do.

有帮助吗?

解决方案

you can send unavaiable presence. it's: new Presence(Type.unavaiable); I work for me

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top