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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:43:20+00:00 2026-06-18T06:43:20+00:00

What to do when: 1. The app uses a complex structure of Activities and

  • 0

What to do when:
1. The app uses a complex structure of Activities and Fragments
2. I return to a backgrounded application that has been (partially or not) destroyed in the meantime
3. It returns me to the last screen, which lies deep in the workflow
4. I need it to return to the first screen to reinitialize things (because it’s complex and requires user interaction)

Just to be clear:
I am asking how to deal with the existing stack(s) of Activities and Fragments upon encountering this situation.
– action to take: launch an Intent? Just finish? Do something to held substructures and then finish?
– when to perform it – immediately in both Activity.onCreate and Fragment’s empty constructor? Or are Activities sufficient?
– How best to detect it: all I’ve come up with so far is: binding to a Service that holds the necessary data/connection, and then asking if it’s been initialized. But the binding finishes AFTER onResume.

I am not asking about anything UI-related.
I am not asking for a solution that will only work for one specific application, so don’t ask for code.
If you see this question as vague, here is a one-sentence version: “How to dismiss the stack and return to the first screen?“

For details (as much, at least, as are relevant), see https://stackoverflow.com/questions/14650342.

  • 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-06-18T06:43:21+00:00Added an answer on June 18, 2026 at 6:43 am

    If your goal is to dismiss all the activities and get back to your home/main activity then you can simply use:

    Intent intent = new Intent(getApplicationContext(), Home.class);
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
    startActivity(intent);
    

    This will clear all the activities on top of home and return you to the home screen.

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

Sidebar

Related Questions

My app is a very complex game that uses json objects to store its
Setting up a WCF service that uses the webHttpBinding... I can return complex types
My app uses HoneyComb fragments where my left side panel has listview and right
I've got a fairly visually complex app that has a base UIViewController and several
I am building an app that has multiple useful functionalities. One activity uses google
I have a fairly complex app that uses celery, mongo, redis and pyramid. I
I have a very complex application that uses CUDA and was write in C.
I have developed an application for a friend. Aplication is not that complex, involves
My app uses Handler and sendEmptyMessageDelayed to get timed messages that produce debug output.
Our app uses a component that requires a license file in the directory with

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.