Fragment
Static library support version of the framework's android.app.Fragment. Used to write apps that run on platforms prior to Android 3.0. When running on Android 3.0 or above, this implementation is still used; it does not try to switch to the framework's implementation. See the framework android.app.Fragment documentation for a class overview.
The main differences when using this support version instead of the framework version are:
- Your activity must extend FragmentActivity
- You must call getSupportFragmentManager to get the FragmentManager
Inheritors
Constructors
Types
Functions
Returns a property delegate to access parent activity's ViewModel, if factoryProducer is specified then ViewModelProvider.Factory returned by it will be used to create ViewModel first time. Otherwise, the activity's default factory will be used.
Clears the stored result for the given requestKey.
Clears the stored FragmentResultListener for the given requestKey.
Helper method for creation of ViewModelLazy, that resolves null passed as factoryProducer to default factory.
final in a future version of Fragment.requireActivity().getResources().true if this fragment instance's state will be retained across configuration changes, and false if it will not.final in a future version of Fragment.view is about to be shown.null if none is set.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.
Sets the FragmentResultListener for a given requestKey. Once this Fragment is at least in the androidx.lifecycle.Lifecycle.State.STARTED state, any results set by setFragmentResult using the same requestKey will be delivered to the FragmentResultListener.onFragmentResult callback. The callback will remain active until this Fragment reaches the androidx.lifecycle.Lifecycle.State.DESTROYED state or clearFragmentResultListener is called with the same requestKey.