ChatStateListener 的 stateChanged 只被调用一次

stateChanged for ChatStateListener get called only once

我正在使用 asmack 为 android 创建 xmpp 客户端。我正在使用 ChatStateListener 在 2 个用户之间的聊天中实现键入状态。我遇到了 stateChanged 只被调用一次的问题。如果我关闭聊天并再次创建它,那么 stateChanged 会被调用一次,但之后不会。我不确定是什么问题。请帮我解决一下这个。 谢谢

If you look-up the Asmack lib then you can see method updateChatState(Chat paramChat, ChatState paramChatState) will check whether your current state are same as old state , if yes then that method return false and this is the reason why you are not getting callback every time .

有关更多信息,您可以查看此 SO 答案