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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T08:55:02+00:00 2026-05-20T08:55:02+00:00

I am writing an Android app which requires the user to be logged in.

  • 0

I am writing an Android app which requires the user to be logged in. I have a main Activity, and I want that when the app launches, that it takes the user to a login screen if they are not already logged in.

How should I model this? Is the login page another Activity? I’m thinking not because I don’t want the user to be able to get back there using the back button. Or is there a way to replace an activity with another so the back button problem doesn’t happen?

Or, should I have just one activity and load in a login view and swap it out once the user logs in?

Are there any best practices around this?

Thanks!

  • 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-20T08:55:02+00:00Added an answer on May 20, 2026 at 8:55 am

    I would check on the main or splash screen to check if the user is logged in, if not start the login activity.

    Once the login completes, in the login activity, call this.finish()

    If you need to change activities, you can call .finish() followed by starting whatever activity you wanted.

    If getting back to the splash/main screen without being logged in is a problem, you can do the same thing there.

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

Sidebar

Related Questions

I'm writing an Android application which requires the user to login. I have a
I'm writing an Android app. I have a main method, which creates and runs
I am writing an Android app. I have an activity in my main project
I am writing an Android app in which I have a Map activity where
I am writing an app that requires you to be logged in to a
I am writing an android app for which I want to write a function
I'm writing an Android app, in which I have several buttons laid out in
I am writing a simple android app which have a edittext and a button.
Possible Duplicate: Check orientation on Android phone I am writing an app that requires
I'm writing an Android app, which uses location services. I want to detrmine the

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.