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 8288143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:13:18+00:00 2026-06-08T12:13:18+00:00

Problems The activity which will do registration will be shown only once After registration

  • 0

Problems

  1. The activity which will do registration will be shown only once
  2. After registration the control should move to
    next main activity

I have used following code

Below code will not meet my requirement?

Any Help will be appreciated!!

Code in Registration Activity

    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    SharedPreferences.Editor editor=prefs.edit();
    editor.putBoolean("registration", true);
    editor.commit();

Code in Main Activity

SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    boolean regComplete =prefs.getBoolean("registration", false);
    SharedPreferences.Editor editor =prefs.edit();
    editor.putBoolean("registration", false);

    editor.commit();

    if(regComplete)
    {
       startActivity(new Intent(this, SecureXActivity.class));
    } else 
    {
       startActivity(new Intent(this, LoginActivity.class));

   }
  • 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-06-08T12:13:19+00:00Added an answer on June 8, 2026 at 12:13 pm

    Just put your Registration code in SecureXActivity.class

    and Check for the Registration before setContentView(), if its not done then start LoginActivity.class

    And in LoginActivity.class after registration complete put these code,

    SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
    SharedPreferences.Editor editor=prefs.edit();
    editor.putBoolean("registration", true);
    editor.commit();
    

    If you use this approach then I think you don’t need Main Activity class..

    And keep in mind this all thing done at time of your application’s first run not at the time of installation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have an application which after login, loads a main activity which contains
I have only one httpclient in my 1st activity which is used in all
I have an activity which consists of a ListView . The problem is that
I have some problem with Android AsyncTask. There is an Activity which contains some
I have a problem to test my non activity-class which need the context of
I have the following problem: I opened the activity A, from which I opened
right to business. I have an activity feed which gets all different kinds of
I have an Activity which looks up data from the web in its onCreate
I have an activity which I'm using LayoutInflater in order to add views and
I have one Activity in which I try to show some simple messages, and

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.