I really need help, i have tried all the alternativas but i cant found the error.
I create a ChatManagerListener to listen for incoming messages, its works ok, but, when i create a chat, the smack is creating two different threads.
My code:
manager = ChatManager.getInstanceFor(MyXMPP.getConnection());
manager.addChatListener(new ChatManagerListener() {
@Override
public void chatCreated(Chat chat, boolean createdLocally) {
if(!createdLocally) {
chat.addMessageListener(new MyMessageListener());
}
}
});
Creating a chat:
chat = manager.createChat(user, new MyMessageListener)
;