Question

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.

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top