Building UserScope with Dagger2
Mirek Stanek
694

I don’t really like your approach of connected user. For me this should be made as a service and not directly bounds to your activities.

like that you don’t have to create an abstract baseActivity or check in every activity if the user is still connected, your service will handle it.

like this part of code :

private void setupUserComponent() {

isUserSessionStarted = userManager.isUserSessionStartedOrStartSessionIfPossible(); onUserComponentSetup(userManager.getUserComponent());

This is big security flow code and have nothing to do in an activity for me. Imagine isUserSessionStartedOrStartSessionIfPossible takes 2 mn ?

Show your support

Clapping shows how much you appreciated mcfly’s story.