How to make such a thing in the application, for example: Registration comes out, you register, and the next time you enter this registration window there will be no more.

  • if the answer helped, please mark it as correct, according to the rules. - Evgeny Suetin

1 answer 1

You can use the SharedPreference for this where you save the logged-in user ID, for example, and when you start the application, you will check the values ​​stored by the ID tag in the SharedPreference and if it exists, load the new activity , and if it is equal to the default value, then show the registration screen. Also with the exit, you simply write down the default value in the ID, thereby showing that the user is not in the system (application).

A good lesson on how to use SharedPreference

  • one
    I don’t really need registration, but rather: The user chooses a role for himself, and then plays that role. When another application is launched, it will no longer have a choice of roles available to it, but the game itself will already be. Although the principle is the same, right? - FLWRZ4U
  • @ user207012 yes, that's right, the principle is the same. - Evgeny Suetin