如何在asmack android中获取输入状态

时间:2014-03-06 13:03:25

标签: xmpp smack asmack

我做了以下但没有得到任何打字空闲状态我需要很多帮助xmpp如果有人可以帮我这样做

public class MessageListenerImpl implements MessageListener,ChatStateListener  {
    @Override
    public void processMessage(Chat arg0, Message arg1) {
        System.out.println("Received message: " + arg1);

    }
    @Override
    public void stateChanged(Chat chat, ChatState state) {
        if (ChatState.composing.equals(chat)) {
            Log.DEBUG("Chat State",chat.getParticipant() + " is typing..");
        } else if (ChatState.gone.equals(chat)) {
            Log.DEBUG("Chat State",chat.getParticipant() + " has left the conversation.");
        } else {
            Log.DEBUG("Chat State",chat.getParticipant() + ": " + state.name());
        }
    }
}

0 个答案:

没有答案