Can someone tell me why Smack Presence.getMode () gives null in case of an accessible (online) contact?

I am working on a chat application on Android using XMPP. I retrieve the presence of RosterEntery when the Presence: Available object is present (online). And I call presence.getMode() , which returns null .

Can someone tell me why presence.getMode() returns null in case of an online contact? And when the presence object contains: accessible (off) or (dnd), then Presence.getMode () works fine. Can anyone help me on this?

+4
source share
1 answer

The Smack library documentation states: "Returns the presence update mode or null if the mode is not set. The value of the zero presence value is interpreted as the same as Presence.Mode.available."

https://www.igniterealtime.org/builds/smack/docs/latest/javadoc/org/jivesoftware/smack/packet/Presence.html#getMode%28%29

+2
source

All Articles