ViewModelPropertyDelegate
class ViewModelPropertyDelegate<P : Any>(key: String) : ReadOnlyProperty<Any?, P>
Content copied to clipboard
This can be used to store a property of a fragment in a ViewModelStore. The property will be encapsulated in a ViewModel and stored, so that it can be retrieved upon re-creation of a fragment.
Parameters
P
The type of the property being delegated.
key
Unique identifier for P.