For example, I have activity A, activity B, activity C.
In activity A, I have an instance of sfsClient that handles the login process, etc.
After logging in from activity A, I log the user in to the "general zone" (in activity B). On click from activity B, I want the user to move to the game zone, therefore I disconnect-reconnect to move the user to the game zone.
In activity C, should I reuse the sfsClient from activity A? Because in activity B, I reuse the sfsClient from activity A to disconnect-reconnect. However, if I reuse the sfsClient from activity A, does that mean I have to define all the dispatch() for activtiy C in activity A? If I re-init, does that mean I have reconnect the user again so that the newly init smartFox can handle the dispatch() in activity C?
One thing I've noticed though, each time I call finish(), I would get disconnected from the server, so I have to put the activities to the stack.
Code: Select all
Intent mainMenuIntent = new Intent(getApplicationContext(), MainMenuActivity.class);
// I cannot call finish here, because I would get disconnected. (the login session destroyed will be destroyed and I would be disconnected)
Sorry for the newbie question. I'm still quite novice and will love to learn more Thank you very much for the help.