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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:27:25+00:00 2026-05-23T04:27:25+00:00

I came to do the eternal question, which so far have not found a

  • 0

I came to do the eternal question, which so far have not found a solution, I searched on the internet the same problem but found a final solution to this problem.

when I have 2 activities open and I pull the ‘Home Button’ and then press the shortcut for my application, it shows me again the first activity (the launcher activity), and then to return to the activity that was displayed, I have to press the back button.

what is the solution to this problem?

I want to press the shortcut of my application (after having left my application by pressing the Home Button) show me the last activity was displayed, instead it shows me the first activity (activity launcher).

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-23T04:27:26+00:00Added an answer on May 23, 2026 at 4:27 am

    That is the expected behavior. The launcher will launch the Activity with the filter android.intent.action.MAIN.

    There are ways to work around it, though. A very simple one is to have a boolean flag mRunning that you will set to true upon launch. If true, then on the onStart() method you start an intent to launch your second Activity; if false, then go on with setContentView().

    If you have several activities to go back to, then a feasible approach is to save the current activity in SharedPreferences and launch it the same way.

    Alternatively, your main Activity may be just an entry Activity whose only job is to start the last Activity used.

    EDIT: I found this duplicate question: How to make an android app return to the last open activity when relaunched? that has a much better ansewr than mine.

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

Sidebar

Related Questions

I have a list M below which came from an external file (This is
I've searched this and some pages came which weren't really useful or were too
Hey, Since Google Fonts came out, I have had this question in mind. First
Question I'd like to have an anchor in the page that performs the same
(Came up with this question in the course of trying to answer this other
I came across this recently, up until now I have been happily overriding the
This came up from this answer to a previous question of mine . Is
This came up in Hidden features of Python , but I can't see good
I have a SVN external setup in my code which pulls all the code
I just came across this question about initializing local variables. Many of the answers

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.