Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 571981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:33:55+00:00 2026-05-13T13:33:55+00:00

I have a username, password, and checkbox (next to the text ‘remember me’). How

  • 0

I have a username, password, and checkbox (next to the text ‘remember me’).

How do I to implement a remember me function to keep username and password data??

Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:33:55+00:00Added an answer on May 13, 2026 at 1:33 pm

    You can save values associated with your application using Preferences.

    Define some statics to store the preference file name and the keys you’re going to use:

    public static final String PREFS_NAME = "MyPrefsFile";
    private static final String PREF_USERNAME = "username";
    private static final String PREF_PASSWORD = "password";
    

    You’d then save the username and password as follows:

    getSharedPreferences(PREFS_NAME,MODE_PRIVATE)
            .edit()
            .putString(PREF_USERNAME, username)
            .putString(PREF_PASSWORD, password)
            .commit();
    

    So you would retrieve them like this:

    SharedPreferences pref = getSharedPreferences(PREFS_NAME,MODE_PRIVATE);   
    String username = pref.getString(PREF_USERNAME, null);
    String password = pref.getString(PREF_PASSWORD, null);
    
    if (username == null || password == null) {
        //Prompt for username and password
    }
    

    Alternatively, if you don’t want to name a preferences file you can just use the default:

    SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(this);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two text field boxes; username and password. There is also a checkbox
I have two EditTexts for a username and password, each having the text ENTER
I have following code in JavaScript function checkEntries() { if(document.getElementById(username)== && document.getElementById(password).value==) { alert(Please
For web sites that have username/password text input fields, the browser usually handily offers
I have read this question: How do I implement a 'Remember me' function in
I have a website that allows a person to create an account with username/password.
I have a User database table that has the following fields, Id Username Password
I have code to check username and password in test.php file. But when I
i have a username textbox and a password textbox in the webpage. i want
I have a simple login screen with username and password. I'd like it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.