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

The Archive Base Latest Questions

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

I am new to Android development. I have created a main Activity (->A), which

  • 0

I am new to Android development.

I have created a main Activity (->A), which has 4 buttons. One of the 4 buttons is the EXIT-button.

I start another activity (->B), on click of the EXIT-button. This opens ‘B’Activity via an intent from ‘A’Activity.

Activity ‘B’ contains – Do you want to exit? Yes-Button & No-Button.

If I give finish(), onclick of the button – it exits the ‘B’Activity. I want to finish ‘B’ & ‘A’.

I have even tried A.finish() -> this doesn’t get recognized and results in syntax/semantic error.

I would appreciate help here.

P.S : I am using Android-2.2 version phone, and I do not like to use ActivityManager to resolve this.

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

    Try to launch child activity with

     startActivityForResult(intent, REQUEST_EXIT);
    

    In child activity

    case R.id.quit:
         setResult(RESULT_OK, null);
         finish();
    

    In parent activity

     @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    
        if (requestCode == REQUEST_EXIT) {
             if (resultCode == RESULT_OK) {
                this.finish();
    
             }
         }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to Android development, I have created an animation which I have associated
I am new to Android development. I have created an Activity with the ListView
I am very new to android development.... i have created an app and want
I am new to android development, I have created a string variable with EditText
I`m relatively new at Android development, although I have created a few basic applications.
I'm new in Android development and I have the next question/problem. I'm playing around
I am new to android development but in the past few weeks I have
Newbee to Android development. I am developing a application, which have three different tabs.
I am new to android development and I have been having issues with Force
I am writing event based android application in which I start main thread which

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.