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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T07:42:35+00:00 2026-06-01T07:42:35+00:00

Problem : I have say 4 activities A, B, C and D. A —

  • 0

Problem : I have say 4 activities A, B, C and D.

A — calls –> B — calls –> C

new activity call is done using startActivityForResult(… , …)

now my problem is that if I simply call finish on activity C, then onActivityResult(…) is called as expected. But I want to finish C and startActivity(D,…);

// Code from C where I’m calling finish().

public void onSettingsClick(View v) {
    System.out.println("My Parent ====== "+getParent());
    if (getParent() == null) {
        setResult(Activity.RESULT_CANCELED, new Intent());
    } else {
        getParent().setResult(Activity.RESULT_CANCELED,new Intent());
    }
     finish();
     StartActivityUtil.launchSettings(this);// call to Activity D is done here
}

Plz Help me out, have tried different sol. but no luck 🙁

Also I always get getParent() = null

  • 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-01T07:42:35+00:00Added an answer on June 1, 2026 at 7:42 am

    You need to undertand, finish and startActivity are asynchronized methods, means calling these methods, does not indicate that finish would get called, immediately, and then control would go to startActivity, these commands would be added into queue, and as system, will start activity D, without returning results to parent activity, to get rid of this situation, first finish your activity C, and in onActivityResult on B start Activity D according to the condition

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

Sidebar

Related Questions

I have a problem that I can't resolve. Let's say I have this map
I have a problem ! I have 3 Activities, DB, and WebServer. Let say
I have created two activities say A and B. Activity A lists list of
Lets say I have three Activities in my App. 1) Signup Activity 2) AccountActivate
i have problem use link_to_remote link_to_remote document example say link_to_remote Delete this post, :update
I have a problem with my path. Say I have a PHP file in
Consider this problem: I have a program which should fetch (let's say) 100 records
I have a problem with the Microsoft EnterpriseLibrary validation framework. Let's say we have
A toy-case for my problem: I have a numpy array of size, say, 1000:
I have this problem where after a field (say Field3 in table MyTable) is

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.