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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:40:59+00:00 2026-06-02T16:40:59+00:00

Scenario Activity A (login) starts activity B then finish(); Activity B calls startActivityForResult(Activity C)

  • 0

Scenario

Activity A (login) starts activity B then finish();

Activity B calls startActivityForResult(Activity C)

Activity C runs nicely, then exits after choosing a phone number (as it should)

— Back to the desktop (app stops)!

Why didn’t it get back to Activity B’s onActivityResult()?

Notes

I have created the proper onActivityResult() on activity B.

I have searched and read every shred of data on stackoverflow about startActivityForResult.

Code Slips

The code which starts Activity B:

ComponentName   component   = new ComponentName("com.emobiletelecom", PokeTALK.class.getName());
    Intent          intent      = new Intent();
    intent.setComponent(component);
startActivity(intent);
    finish();

The code which starts Activity C:

startActivityForResult(new Intent(this, ContactsPickerActivity.class), 2007);

The code finishing Activity C:

Intent intent = new Intent();
    intent.putExtra(KEY_PHONE_NUMBER, contactNumber); 

    setResult(RESULT_OK, intent);
    finish();
enter code here

LOG

04-23 16:32:27.382: I/ActivityManager(28158): START 

{cmp=com.emobiletelecom/com.codinguser.android.contactpicker.ContactsPickerActivity} from pid 30108
04-23 16:32:27.392: W/WindowManager(28158): Failure taking screenshot for (180x300) to layer 21010
04-23 16:32:27.432: V/PokeTALK(30108): onPause
04-23 16:32:27.642: I/WindowManager(28158): createSurface Window{415eefe8 com.emobiletelecom/com.codinguser.android.contactpicker.ContactsPickerActivity paused=false}: DRAW NOW PENDING
04-23 16:32:27.812: V/PhoneStatusBar(28212): setLightsOn(true)
04-23 16:32:28.042: I/ActivityManager(28158): Displayed com.emobiletelecom/com.codinguser.android.contactpicker.ContactsPickerActivity: +599ms
04-23 16:32:28.192: V/PT(30108): onStop - PokeTALK
04-23 16:33:00.292: D/dalvikvm(28212): GC_CONCURRENT freed 396K, 36% free 10580K/16391K, paused 14ms+8ms
04-23 16:33:24.102: D/dalvikvm(30108): GC_FOR_ALLOC freed 189K, 6% free 12032K/12679K, paused 52ms
04-23 16:33:24.122: I/dalvikvm-heap(30108): Grow heap (frag case) to 13.159MB for 1390096-byte allocation
04-23 16:33:24.232: D/dalvikvm(30108): GC_CONCURRENT freed 33K, 6% free 13355K/14087K, paused 4ms+4ms
04-23 16:33:24.341: D/dalvikvm(30108): GC_FOR_ALLOC freed 0K, 6% free 13356K/14087K, paused 34ms
04-23 16:33:24.351: I/dalvikvm-heap(30108): Grow heap (frag case) to 14.452MB for 1390096-byte allocation
04-23 16:33:24.522: D/dalvikvm(30108): GC_CONCURRENT freed <1K, 6% free 14713K/15495K, paused 18ms+5ms
04-23 16:33:27.342: W/WindowManager(28158): Failure taking screenshot for (180x300) to layer 21015
04-23 16:33:27.392: W/NetworkManagementSocketTagger(28158): setKernelCountSet(10005, 1) failed with errno -2
04-23 16:33:27.442: I/WindowManager(28158): createSurface Window{41614cd0 com.android.launcher/com.android.launcher2.Launcher paused=false}: DRAW NOW PENDING
04-23 16:33:27.532: W/InputManagerService(28158): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@413fbdb0 (uid=10040 pid=30108)
04-23 16:33:28.292: W/NetworkManagementSocketTagger(28158): setKernelCountSet(10040, 0) failed with errno -2
  • 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-02T16:41:01+00:00Added an answer on June 2, 2026 at 4:41 pm
    I call finish() on the following methods: onStop(), onKeyDown(back key clicked), finishFromChild()
    

    I believe finishFromChild() is where activity B is being accidentally closed. finishFromChild() is called when the child activity (C in this hypothetical) calls finish(). So this command might be the one closing activity B when you don’t mean to.

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

Sidebar

Related Questions

Scenario: First activity starts seconds activity with startActivityForResult Second activity starts third activity with
Here's the scenario: Start Activity A Activity A starts service S Service S runs
Here's the scenario: In activity A I have post to Twitter option which calls
I have a scenario where, after logging in through a login page, there will
Here's the scenario. I have: A LOGIN activity A SESSION where I have methods
Scenario : An activity is displayed. It has a text box and a button.
I have the following scenario: in activity A, when a user clicks a button,
Here's the scenario, I want to get Data from the Service to Activity Whenever
i have a scenario, user logins and goes to activity A in my android
I have this scenario onResume of an activity: @Override protected void onResume() { if

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.