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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T10:22:38+00:00 2026-06-17T10:22:38+00:00

I use AActivity call BActivity, and BActivity call CActivity. As below code: In AActivity:

  • 0

I use AActivity call BActivity, and BActivity call CActivity.
As below code:
In AActivity:

Intent intent = new Intent();
intent.setClass(AActivity.this, BActivity.class);
startActivity(intent);

In BActivity:

Intent intent = new Intent();
intent.setClass(BActivity.this, CActivity.class);
startActivity(intent);

If in CActivity I pressed back button, I want to launch AActiviy directly.
But not call BActivity.
How can I modify it?

  • 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-17T10:22:40+00:00Added an answer on June 17, 2026 at 10:22 am

    In BActivity:

    Intent intent = new Intent();
    intent.setClass(BActivity.this, CActivity.class);
    this.finish();  //***** Add this
    startActivity(intent);
    

    This will pop B off the back stack, so that when you press the back button from CActivity, the next one in the stack, AActivity will be displayed.

    Note – This differs from the answer above. In this approach, you return to AActivity in its previous state (for the most part). In the first answer above, you would be launching a new instance of AActivity thus adding one more activity to the back stack. You need to pick which approach suites your needs better.

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

Sidebar

Related Questions

I use a TabHost. The below code to call AActivity. intent = new Intent().setClass(this,
I use group for tabhost. In MyGroup, below code to call AActivity: Intent intent
This is my codes below. I'm trying to use intent to call another activity
I use below code to open .doc file by call other application. But I
In this sample code StartActivity is giving error, if i use this in another
I try use below code to load an URL. URL url = new URL(urlstr);
My use-case is as follows: In activity A I call: startActivity(B); finish(); Now in
My code's below. What I don't really understand is how to use the buttons
Is there any command i can use in activity class that disables TextViews that
Problem Description I have a function StdString ShowLockScreen() in this function I call activateViewController

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.