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

  • SEARCH
  • Home
  • 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 7812221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T04:26:18+00:00 2026-06-02T04:26:18+00:00

I want create an app for my institute. The problem is: my application will

  • 0

I want create an app for my institute.

The problem is: my application will have two layouts (login and dashboard).

Students can correctly fill out the login form, enter the dashboard, press buttons, and fill other fields. But if the user then presses the back button, it should not return to the login screen, but remain in the dashboard, or failing that, exit the application.

Then if a student reopens the application and it’s already logged, he should be automatically redirected to the dashboard, and not the login screen, unless the user press the logout button on the dashboard, then redirect him back to the login screen.

How could you do that?

Edit: I implemented 2 intents and 2 activities, and new questions arose me is that when I press the home button and from the taskmanager I open the app, open in the activity that was left, but if the open from the icon to open the app again from the first activity, as do to open in the last one was left?

  • 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-02T04:26:20+00:00Added an answer on June 2, 2026 at 4:26 am

    I’ve implemented something similiar using SharedPreferences. I did this:

    LoginActivity

    SharedPreferences settings;
    public void onCreate(Bundle b) {
        super.onCreate(b);
        settings = getSharedPreferences("mySharedPref", 0);
        if (settings.getBoolean("connected", false)) {
            /* The user has already login, so start the dashboard */
            startActivity(new Intent(getApplicationContext(), DashBoardActivity.class));
        }
        /* Put here the login UI */
     }
     ...
     public void doLogin() {
        /* ... check credentials and another stuff ... */
        SharedPreferences.Editor editor = settings.edit();
        editor.putBoolean("connected", true);
        editor.commit();
     }
    

    In your DashBoardActivity override the onBackPressed method. This will take you from DashBoardActivity to your home screen.

    @Override
    public void onBackPressed() {
        Intent intent = new Intent(Intent.ACTION_MAIN);
        intent.addCategory(Intent.CATEGORY_HOME);
        startActivity(intent);
    }  
    

    Hope it helps.

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

Sidebar

Related Questions

Actually I have the following scenario: I want to create an app that will
I have two paid apps on app store. I want to create one app
I want to create a PHP app that can send text messages ; There
I want to create a web app that will use wicket, hibernate and spring
I want to create a Facebook app that can operates inside IFrame / FB
I want to create my own PHP web app where people can signin with
I want to create some tests for my app and I have the following
I want to create my app using spanish controllers/methods. can I use scaffold? scaffold
So, i want to create an app that can give it's user a notif
i want to create an application which will not launch in AppStore but all

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.