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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:33:13+00:00 2026-05-31T08:33:13+00:00

I have 5 activities (let’s say A,B,C,D and E ). Activities A to D

  • 0

I have 5 activities (let’s say A,B,C,D and E).
Activities A to D are for setting some data, so user may be able to go back and forth changing whatever.
Activity E, on the other hand, is the summary, so the user is no longer allowed to go back.

My idea is to finish all previous activities when user gets to E

Currently my activities A to D have no flags attached to them.

Activty E is called like this:

Intent I = new Intent(this, SomeClass.class);

I.setFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);

startActivity(I);

I have read everywhere that those flags are supposed to achieve what I am trying to do, but they doesn’t, when user gets to activity E and presses Back button, the application goes back to activity D.

Any ideas? I am missing something? Is this not the right way to solve this problem?

Thanks for your help

  • 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-31T08:33:14+00:00Added an answer on May 31, 2026 at 8:33 am

    Use the method startActivityForResult in each of the activities A, B, C, D instead of startActivity. And when the user exits out of Activity E, handle the backbutton and set the result code in the intent. now in the onActivityResult method of each A, B, C and D classes handle it , close the activity and pass the result to previous activity.

    You can also do it as soon as user finishes Activity D. When users go from D to E, you may use the above method to actually go all the way down to Activity A and then open activity E and finish Activity A.

    Both the above cases produce the same result from users perspective and they do not see the intermediate activities A, B, C, D unless you are doing some long jobs in the onStart method of those activities.

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

Sidebar

Related Questions

I've embedded all the activities for a user and let's say most user has
Let's say I have 4 activities in my app: A (main activity) B C
I have a problem ! I have 3 Activities, DB, and WebServer. Let say
I have an application which has two Activities, let's call them A and B.
Let's say I have an Activity which displays a View containing a TextView .
Let's say that I have two layouts for a widget: Layout1 and Layout2. The
I have a situation where I have 2 Activity objects (let's say empty and
let's see how to explain this issue. I have 4 activities and 1 layout
I am creating an activity table with many types of activities. Let's say activities
Probably a common problem, but anyway: Let's say I have a simple entity Task

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.