我做了以下但没有得到任何打字空闲状态我需要很多帮助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());
}
}
}