Problems with MessageListener!

Good morning!

I am building an application with Smack, and when the user will start,

it is logged with loginAnonymously (), so I kero give the user the

option to disconnect power as loginAnonymously (), can click a button

and then have the possibility of put a login and password and login

again.

That I could, but I am having problems in my listener of

messages, because as of now the user disconnects anonymously, and

connects with the listener login and password of messages no longer

works.

I accept all aid!

Thanks to everyone!
FramePrincipal.java (62865 Bytes)

The example code is way too convulted to analyse quickly.

Anyway, every time you have a new chatsession, you have to bind a listener to it. You need to check if it already has one though, so you don’t add the listener multiple times. I remove any listeners and add mine, just in case.