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

The Archive Base Latest Questions

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

So I have 2 activities lets say A and B. A navigates to B,

  • 0

So I have 2 activities lets say A and B. A navigates to B, I want the activity A to be killed or make it unusable/unseen when directed from B.
so it should be like when I press the back button on B activity it should not open activity A instead it should go to the app tray.

also activity A should comeback when I clear the application data
thanks.

  • 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-17T17:11:39+00:00Added an answer on June 17, 2026 at 5:11 pm

    You could do this in one of two ways. First is finishing ActivityA so that it can’t be resumed to later. When starting ActivityB from ActivityA, you’d do something like this:

    Intent intent = new Intent(this, ActivityB.class);
    startActivity(intent);
    this.finish();
    

    Another way is to just finish ActivityA when it gets a result of any sort from ActivityB. This code would also be in ActivityA.

    To start ActivityB:

    Intent intent = new Intent(this, ActivityB.class);
    startActivityForResult(intent, REQUEST_ACTIVITYB);
    

    To make sure ActivityA doesn’t resume:

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
    
        if(requestCode == REQUEST_ACTIVITYB) {
            finish();
        }
    }
    

    REQUEST_ACTIVITYB is just an int of your choosing.

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

Sidebar

Related Questions

I have an app that contains several activities...so lets say user is navigating activity
Its possible to retain a Fragment between Activities? Lets say I have Activity A
Lets say you have one main activity called main, and other sub-activities that do
Lets say I have three Activities in my App. 1) Signup Activity 2) AccountActivate
I have two activities. In first I come to the second activity from first
Let's say I have 4 activities in my app: A (main activity) B C
Here is the scenario: I have two Activities. Lets name them Activity A and
Lets say we have activities A, B. A starts B and passes an Intent
How to achieve this behavior: Lets say i have activity A Then i start
I have 2 activities lets say A and B. In the first one(A) I

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.