Answer the question
In order to leave comments, you need to log in
How to save the user after authorization?
there is an activity (1), where a person logs in and comes to another activity (2), when you press back on 2, he goes to 1, that is, he does not save, does not understand that the person has entered, how to save and do so that when you press back on the phone transferred to another asset, saving all this
Answer the question
In order to leave comments, you need to log in
Good afternoon,
The simplest thing you can do in order not to fall into the activity login is to finish the activity login at the start of activity 2, like this:
class LoginActivity extends Activity {
...
private void startActivity2() {
Intent intent = new Intent(this, Activity2.class);
startActivity(intent);
finish();
}
...
}
Use AccountManager, save the user's refresh token and other information necessary for re-authorization in it, and from the authorization activity, if there is an authorized user and a valid token, throw it on the desired activity.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question