Package icyllis.modernui.fragment
Interface FragmentResultOwner
- All Known Implementing Classes:
- FragmentManager
public interface FragmentResultOwner
A class that manages passing data between fragments.
- 
Method SummaryModifier and TypeMethodDescriptionvoidclearFragmentResult(String requestKey) Clears the stored result for the given requestKey.voidclearFragmentResultListener(String requestKey) Clears the storedFragmentResultListenerfor the given requestKey.voidsetFragmentResult(String requestKey, DataSet result) Sets the given result for the requestKey.voidsetFragmentResultListener(String requestKey, LifecycleOwner lifecycleOwner, FragmentResultListener listener) Sets theFragmentResultListenerfor a given requestKey.
- 
Method Details- 
setFragmentResultSets the given result for the requestKey. This result will be delivered to aFragmentResultListenerthat is called given tosetFragmentResultListener(String, LifecycleOwner, FragmentResultListener)with the same requestKey. If noFragmentResultListenerwith the same key is set or the Lifecycle associated with the listener is not at leastLifecycle.State.STARTED, the result is stored until one becomes available, orclearFragmentResult(String)is called with the same requestKey.- Parameters:
- requestKey- key used to identify the result
- result- the result to be passed to another fragment
 
- 
clearFragmentResultClears the stored result for the given requestKey.This clears any result that was previously set via setFragmentResult(String, DataSet)that hasn't yet been delivered to aFragmentResultListener.- Parameters:
- requestKey- key used to identify the result
 
- 
setFragmentResultListenervoid setFragmentResultListener(@Nonnull String requestKey, @Nonnull LifecycleOwner lifecycleOwner, @Nonnull FragmentResultListener listener) Sets theFragmentResultListenerfor a given requestKey. Once the givenLifecycleOwneris at least in theLifecycle.State.STARTEDstate, any results set bysetFragmentResult(String, DataSet)using the same requestKey will be delivered to thecallback. The callback will remain active until the LifecycleOwner reaches theLifecycle.State.DESTROYEDstate orclearFragmentResultListener(String)is called with the same requestKey.- Parameters:
- requestKey- requestKey used to identify the result
- lifecycleOwner- lifecycleOwner for handling the result
- listener- listener for result changes
 
- 
clearFragmentResultListenerClears the storedFragmentResultListenerfor the given requestKey.This clears any FragmentResultListenerthat was previously set viasetFragmentResultListener(String, LifecycleOwner, FragmentResultListener).- Parameters:
- requestKey- key used to identify the result
 
 
-