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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:07:34+00:00 2026-05-23T11:07:34+00:00

The problem: Lets say I have 3 activities: MainMenu, LevelSelection and Game. I have

  • 0

The problem: Lets say I have 3 activities: MainMenu, LevelSelection and Game. I have a button that run an intent in MainMenu to redirect the player to LevelSelection. In LevelSelection is another button that redirect the player to Game. When the activity Game ends it run an intent to redirect the player to the MainMenu activity. However, when tested, the redirection is done to LevelSelection instead of MainMenu.

MainMenu => LevelSelection code

this.finish();
Intent intent = new Intent(this, LevelSelection.class);
this.startActivity(intent);

LevelSelection => Game code

this.finish();
Intent intent = new Intent(this, Game.class);
this.startActivity(intent);

Game => MeainMenu code

this.finish();
Intent intent = new Intent(this, MainMenu.class);
this.startActivity(intent);

Thanks in advance.

  • 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-23T11:07:35+00:00Added an answer on May 23, 2026 at 11:07 am

    In the manifest, I would set No history to true for all your activities. This will prevent the user from going back to a previous activity when the current one closes (or when the user presses “back”). This might be helpful since you’re trying to have strict control over what activity the user goes to.

    I would also remove this.finish(). I think you’re closing the activity before the intent is started. Hence why it goes back to the previous activity instead of the new one.

    Another solution would be to set ‘No history’ to ‘true’ only for LevelSelection. Then, you can simply close the ‘Game’ activity, and it should go back to MainMenu.

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

Sidebar

Related Questions

I have run into an interesting problem lately: Lets say I have an array
I have a problem that is deceptively difficult! Lets say I have a DB
Best to use an example to describe the problem. Lets say I have a
Here is the problem: Lets say a Jquery toggle button which loads a Google
Here's my problem: Lets say I have two dictionaries, dict_a and dict_b. Each of
Similar to my last question, but I ran into problem lets say I have
I have a problem as the topic name says: Lets say i have gallery
Here is the problem. lets say I have a product category table and a
So this is a simpler form of my problem. Lets say I have 2
Lets say I have a class that is supposed to generate some ID (for

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.