Android for automatic login

Source: Internet
Author: User

============ Problem Description ============


Now many apps have automatic login function, the user login once, the next time to enter the app has been logged on, such as the United States, Iqiyi, the way the activity is not on the home page activity. How is this implemented in the background, in the application class with Sharedprefere? Please advise your predecessors

============ Solution 1============


First you have to save the information locally after the first successful login. In the future when you open the app, such as in the Welcome interface to check the local data if there is a record to execute the login action, and then skip the login interface What do you do?

============ Solution 2============


Launch the app in the mainactivity in the OnCreate to determine whether there is local data, if you have to study data, automatic landing, generally with sharedprefered to save

Android for automatic login

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.