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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:52:03+00:00 2026-05-22T11:52:03+00:00

OK I know that I may be thinking about this the wrong way but

  • 0

OK I know that I may be thinking about this the wrong way but …

A) I have activity A loading Fragment F1 which loads fragment F2. F2 performs an action which should result in it being closed and then F1 performing a certain action based on how it was closed.

B) Now because I’m also supporting a single pane, non-fragment, version F1 also loads F2 indirectly via a startActivityForResult call. This means that when F2’s wrapper activity is finished F1 recieves an onActivityResult call and F1 can do what it needs to do.

However, I’m struggling to see the best way to implement what I want for (A). I have F2 calling back to activity A to pop it off of the stack. Should I then be looking at passing a message to F1 to do what it needs to do? Alternatively (I suppose F1 could be responsible for popping F2 off of the stack).

What I’m wondering is whether I’m on the right track with regards passing messages back and forwards via the parent activity or is there a more direct way of F1 responding to F2 performing something that requires it to be closed and F1 do what it needs to do.

Thanks in advance. Peter.

  • 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-22T11:52:03+00:00Added an answer on May 22, 2026 at 11:52 am

    If your fragments are closely tied together, just don’t run them in separate activities. For the single pane case you can just switch fragments within one activity.

    Otherwise, if you do want to separate them between activities, you need to use the onActivityResult() model for propagating results back, and in the dual-pane case “emulate” it by just having the second call onActivityResult() of the first fragment. Note that Fragment.setTargetFragment() includes a request code argument to facilitate this.

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

Sidebar

Related Questions

I know that this may be an amateur question but for some reason I
I know that may sound silly, but I'm trying to submit a form on
For about a year I have been thinking about writing a program that writes
I am thinking about some issues which may match the term software integration best.
I have been trying to search answer for this, but all discussions that I
I know, variations of this question had been asked before. But my case may
Long version: Those familiar to the standardization nightmare of the RSS-family, may know that
may i know what integration technique that you folks use to implement external component
Some of you may know the method in Ruby that allows you to reverse
for website that embed flash to capture camera (red5..etc). may i know is there

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.