I’m planning to implement an Android application that requires a login screen.
If the user opens the activity something like this should happen:
- If user is logged in, goto 3
- If user is not logged in open the login screen and perfom login
- Show my application content
So, what’s the “correct” way of implementing a login?
- Implement a
StartActivitythat perfoms the check if the user is logged in, implement aLoginActivitythat implements the logging and anApplicationActivitythat actually implements the application logics? - Implement just one Activity and handle the login by using multiple views which I show according to the application state?
Are there any examples or tutorials for this scenario?
I don’t think that there is a “correct” way of doing this. Both solutions you describe seem fine to me, although I would merge
StartActivityandLoginActivityinto a single one.