I am building an android app and would like to implement a login check at start. I am starting a Main activity and there i check if the user is logen in(by calling "getSharedPreferences" with my application client key. if its empty then i will startActivity(Login.class), from the Login activity i manage the login, save is in the shared prefernece and then call startActivity(Main.class)
- Is using the android "registry" SharedPreferences is a good way of managing if the user is loged in?
- Is it a good practice to use startActivity in both activities ? or i should somehow go back to my first Main activity and start the login check again (which will pass this time) or is it what the flag "singleTop" in an activity here for ? the secone start activity will call the first Main i created and not create a new one ?