C
C
CeBePHblY2016-05-07 19:26:07
Android
CeBePHblY, 2016-05-07 19:26:07

The first activity worked and is not needed. How to "prohibit" access to it to the user with the "Back" button?

By chance, I started writing an android application with an activity that is allocated for authorization. Upon successful authorization, the second, as expected, the main activity opens, where the user's main work will be. But if the user presses the "Back" button, then the first authorization activity opens again. Apparently I did it wrong, I had to start the project with the main activity, and if there is no token, then open a new second authorization activity. So? Or is there a way to prevent the transition to the authorization window if there is a token.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Elysey, 2016-05-07
@Elysey

startActivity( *your Intent for the second activity*);
finish;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question