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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:07:57+00:00 2026-05-26T08:07:57+00:00

I have a levels.java file where the user can pick one of 3 levels,

  • 0

I have a levels.java file where the user can pick one of 3 levels, then when his choice is made I run this code:

startActivityForResult (new Intent(this, GameScreen.class),requestCode);

which displays the user the “game screen” where he can play for a while, the game is a simple timer game (as I am a noob learning Android) and has a pause function if the user wants to take a break.
I also call the pause function if the user hits the back button on the phone.

My problem is, when the user hits the pause function, does whatever he wants to do then comes back to my app, it shows him the levels.java screen and when he selects to go back into the game it starts a new gamescreen, it does not go back to the paused screen 🙁

Which means any points etc he may have made is gone.

How do I go back to the same screen that he was on before?

In other words:
If old activity is still running return to it, if not start a new activity. But… how?

Thanks!
R

EDIT: The code I run if the user clicks the pause button:

if (r_settings.getPausedValue() == false) {
        ib7.setClickable(false);
        ib2.setClickable(false);
        ib1.setClickable(false);
        r_settings.setPausedValue(true);
        main_image.setImageResource(R.drawable.game_paused);

Basically, check if the game is already paused, if not, disable buttons, set paused value to true, show a graphic that says “Game paused” in the middle of the screen.

  • 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-26T08:07:57+00:00Added an answer on May 26, 2026 at 8:07 am

    Try this:

    Intent intent = new Intent(this, GameScreen.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
    startActivityForResult (intent,requestCode);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tree structure that can be n-levels deep, without restriction. That means
I have the following in my log4j file #set httpclient debug levels log4j.logger.org.apache.component=ERROR,stdout log4j.logger.httpclient.wire=ERROR,stdout
I have made a program that continuously monitors a log file. But I don't
I have a problem showing my progress bar when reading a file in Java.
I have a Java file TestThis.java like the following: class A { public void
I have netbeans with the GWT4NB plugin installed. My code can compile and works
I have java.io.File objects A and B, where A represents a directory and B
As per java.nio.file.Path : A relative path cannot be constructed if only one of
I use VB.NET to create data for my game (for Android, Java code), this
I imported a java project(war file) to eclipse. When I tried to run it

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.