Page 1 of 1

Problem After removing event listner in android

Posted: 02 Oct 2018, 16:44
by harshdchandel
I am making connection with server in base class the there is landing page ,
matching page and actual game page all using same smartfox object .

I am overwriting extension response in each activity in the start i register listner like this :
sfsClient.addEventListener(SFSEvent.EXTENSION_RESPONSE, this);
and handle event in dispatch method and remove the listner while moving to next activity .

and evrything works fine for the first time for the first time .

if the user clicks on retry ,game activity is called again
I am adding addEventListener again after removal , at this point i am not getting anything in the dispatch .

I have removed and added event listner at the start and end of activity , otherwise my response from the server goes to previous activity.

So my problem is after removing event listner in the same class and re registering I am not able to get repopsnse in dispatch method.

Need Help.

Re: Problem After removing event listner in android

Posted: 05 Oct 2018, 15:26
by Lapo
I've tested removing and re-adding listeners for the same event in a Java client and was not able to reproduce the problem.
Events are always triggered correctly.

Maybe there's something else going on in your code that is causing the issue?
In any case what version of the Java API are you using?