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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:21:50+00:00 2026-05-27T00:21:50+00:00

Hi I made a modification in my app which is I want to close

  • 0

Hi I made a modification in my app which is I want to close my app after clicking the back button. This might sound common right? but this is what exactly happens to my app. I have 3 screens: Start Page, Game Page and Score Page. after pressing the start button from the Start page it will start the Game Page Intent. After finishing the game the Game Page will then move the intent into Score Page and when the back button is pressed from the Score Page, the intent will be passed on the Start Page like this:

  1. Start Page -> Game Page
  2. Game Page -> Score Page
  3. Score Page (when back button is pressed) -> Start Page

Now after I go back to the Start Page when I pressed the back button again instead of exiting the app it will just go back to the Score Page and again If I pressed the back button it will go to the Start Page again making an endless loop. I placed this code to my Start Page but it doesn’t solve my problem:

@Override
public void onBackPressed() {
    Startup.this.finish();
}

Do I need to change the flow of my intents or there is a possible solution for this one?

  • 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-27T00:21:51+00:00Added an answer on May 27, 2026 at 12:21 am

    Or you can just use the flag Intent.FLAG_ACTIVITY_CLEAR_TOP when calling the Start page from the Score page.

    Intent intent = new Intent(this, StartActivity.class)
    intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made some modifications to SVG Edit which contains a make file. When I
Made this nice little loop for hiding and showing div's, works as a charm
I made an iphone app to capture image from camera and to set that
I made a Web service in which I have a function to count some
I have published an app on Google Play 15 days ago, I made some
I just want to get back to a clean working directory, exactly as it
Right away: yes I know about INTERNAL_IPS. I'm about to have my django app
I have taken the code from the SDK and made just one modification to
I made very slight modifications from the default app bar, but when I run
After making some major modifications to a Rails app that is already in production,

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.