Is there a method that works like start fragment for result?

All of the Fragments live inside Activities. Starting a Fragment for a result doesn’t make much sense, because the Activity that houses it always has access to it, and vice versa. If the Fragment needs to pass on a result, it can access its Activity and set its result and finish it. In the case of swapping Fragments in a single Activity, well the Activity is still accessible by both Fragments, and all your message passing can simply go through the Activity.

Just remember that you always have communication between a Fragment and its Activity. Starting for and finishing with a result is the mechanism for communication between Activities – The Activities can then delegate any necessary information to their Fragments.

Leave a Comment