setFragmentResult

fun Fragment.setFragmentResult(requestKey: String, result: Bundle)

Sets the given result for the requestKey. This result will be delivered to a FragmentResultListener that is called given to setFragmentResultListener with the same requestKey. If no FragmentResultListener with the same key is set or the Lifecycle associated with the listener is not at least androidx.lifecycle.Lifecycle.State.STARTED, the result is stored until one becomes available, or clearFragmentResult is called with the same requestKey.

Parameters

requestKey

key used to identify the result

result

the result to be passed to another fragment.