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

  • Home
  • SEARCH
  • 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 8834813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T09:06:48+00:00 2026-06-14T09:06:48+00:00

I have three activities: A, B, C. Activity A can start B or C.

  • 0

I have three activities: A, B, C.
Activity A can start B or C.
When A starts C i can return to A just have pressed back button. But i want “return” to B and then to A (with second press of back button).

I tried to use TaskBackStack in this way:

final TaskStackBuilder builder = TaskStackBuilder.create(this)
    .addParentStack(this)
    .addNextIntent(new Intent(this, B.class))
    .addNextIntent(new Intent(this, C.class));
builder.startActivities();

But its not working… Can anyone help me?

Sorry for my English and 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-06-14T09:06:49+00:00Added an answer on June 14, 2026 at 9:06 am

    Before try to answer you question I have some comments about your approach to navigate between your activitys. In general, this approach is not a good idea, because doing that, you are not following the Android Navigation Pattern, and this can make your application not user friendly, since most Android Application use the Navigation Pattern.

    The Android Navigation Pattern says:

    Temporal navigation, or navigation between historical screens, is deeply rooted in the Android system. All Android users expect the Back button to take them to the previous screen, regardless of other state. The set of historical screens is always rooted at the user’s Launcher application (the phone’s “home” screen). That is, pressing Back enough times should land you back at the Launcher, after which the Back button will do nothing.

    However, there is another possiblite to Navigate in your application using The Android Pattern, but I believe that is not a solution for your problem. You can take a look at Up Navigation

    To finalize, I have a relevant comment about solution that uses override the OnBackPressed() to Start a new Activity. You should really avoid that, because using it, you will can make crazy your chronologic navigation. Because when you create an activity inside the OnBackPressed, you are always putting a new activity on Android Stack, so there are two problems here:

    1. The stack can grow quickly depending of the user behavior
    2. Can be hard get out of your applcaiton (Can be very hard to make your stack become empty)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three activities, A, B and C. User can start activity B from
I have three activities that I can call A, B and C. I want
I have three activities A, B and C. A starts B with startActivityForResult(getIntent(), ACTIVITY_B);
I have an activity that starts on demand of the user. The user can
I have three activities where the first activity is the welcome app page(SavingsGuiderSplashActivity) which
I have an application with lots of activities. Many of these activities can start
How can I have an activity return to another activity rather than the one
In my application I have three activities A, B and C. Activity A is
I have a three-page/Activity setup/configuration piece to my app. I want to have two
Ill first tell you what I am doing. I have three activities in the

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.