Persist Login State

This lesson will cover how to store login state in the Android key-value storage.

Flow overview #

When LoginActivity is opened, we need to check the login state:

  • If the user is logged in already, we close LoginActivity and open MainActivity straightaway.
  • If the user is not logged in, we proceed to the regular flow and save the login state in the end.

Get hands-on with 1200+ tech skills courses.