I want create an app for my institute.
The problem is: my application will have two layouts (login and dashboard).
Students can correctly fill out the login form, enter the dashboard, press buttons, and fill other fields. But if the user then presses the back button, it should not return to the login screen, but remain in the dashboard, or failing that, exit the application.
Then if a student reopens the application and it's already logged, he should be automatically redirected to the dashboard, and not the login screen, unless the user press the logout button on the dashboard, then redirect him back to the login screen.
How could you do that?
Edit: I implemented 2 intents and 2 activities, and new questions arose me is that when I press the home button and from the taskmanager I open the app, open in the activity that was left, but if the open from the icon to open the app again from the first activity, as do to open in the last one was left?