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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:29:30+00:00 2026-06-12T02:29:30+00:00

I have three activities, a, b, c . Activity b will start activity c

  • 0

I have three activities, a, b, c. Activity b will start activity c. In activity c when i press the back key, activity c will finish() and activity b will show just as it was left.

That is not that hard, what i am wanting to do is when i finish() activity c, i want to finish() activity b at the same time in order to show activity a.

Does anyone have any idea on how to finish an activity from another activity?

  • 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-12T02:29:31+00:00Added an answer on June 12, 2026 at 2:29 am

    To achieve this best way is to use startActivityForResult and onActivityResult in conjugation.

    From Activity A, start activity B and then from B start activity C for a result using startActivityForResult()

    In Activity C, when the user triggers back or Destroy()

    set a result that will inform A to finish as well,

    Call finish() in C.

    When B receives that result from C, B calls finish() on itself as well.

    In the parent activity, while triggering the child activity, use the following command:-

    startActivityForResult(intent,variable(int));
    

    and override the onActivityResult Method in the following manner in Activity B:-

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

    Now, in the child activity C, override onStop and onDestroy in the following manner:-

    protected void onStop() {
        setResult(2);
        super.onStop();
    }
    
    @Override
    protected void onDestroy() {
        setResult(2);
        super.onDestroy();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My app has three tabs, A, B, C that have three distinct activities. Tab
I have three activities where the first activity is the welcome app page(SavingsGuiderSplashActivity) which
I have three activities in my activity stack, A (main) -> B -> C.
I have three activities: Activity A - Displays a list of data from a
I have three activities 1 is the main activity 2 is some other activity
I have an Android application that contains two Activities . Activity A has a
I have an app which has a main activity that calls other activities on
Lets say you have one main activity called main, and other sub-activities that do
I have an activity that has several views. Most of the views will remain
I have three activities A, B and C. A starts B with startActivityForResult(getIntent(), ACTIVITY_B);

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.