This question has already been answered:

How to start Fragment2 from Fragment1 so that it will return the result to the 1st fragment (as startActivityForResult )? I know how to return the result of the second fragment to the Activity, but how to transfer this data to Fragment1 ?

Reported as a duplicate by pavlofff android Aug 10 '16 at 2:51 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

    1 answer 1

    This question is well described on startandroid.ru. See Lesson 106. Android 3. Fragments. Interaction with the Activity . You need the last section Processing in the Activity event from the fragment at the end.

    • Not that. The description implies that 2 fragments are currently active, and in my case, the first must start the second, and when the second runs, it must transfer the result to the first. - Igor
    • In response, he sketched out a small example of changing fragments within a single container. In the example, fragment 2 transfers the data to fragment 1. - AndreyEKB