- Where Developers Learn, Share, & Build Careers


I'm developing an Android app for the first time and I wanted to create a session for login and logout. I noticed that most people have suggested using shared references but how can I check whether the user is logged out or not? If the user is not on my app and clicks, the sign in page will not appear! Users can go to the main page immediately.

When user login successfully sets the setLogin function and sets it as correct as boolean and When the user comes back, check if the user isLogin () if this is true, then redirect the user to the main page with intent.

  Public Boolean isLogin () {return pref.getBoolean ("Login", Incorrect); } Public Zero Satgulin (Boolean X) {SharedPreferences.Editor Editor = pref.edit (); Editor. Input boolean ("login", x); Editor.commit (); }    

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -