Activity View Model Context
data class ActivityViewModelContext(activity: ComponentActivity, args: Any?, owner: ViewModelStoreOwner, savedStateRegistry: SavedStateRegistry) : ViewModelContext
Content copied to clipboard
The ViewModelContext for a ViewModel created with an activity scope (val viewModel by activityViewModel<MyViewModel>). Although a fragment reference is available when an activity scoped ViewModel is first created, during process restoration, activity scoped ViewModels will be created without a fragment reference, so it is only safe to reference the activity.
Constructors
ActivityViewModelContext
Link copied to clipboard
fun ActivityViewModelContext(activity: ComponentActivity, args: Any?, owner: ViewModelStoreOwner = activity, savedStateRegistry: SavedStateRegistry = activity.savedStateRegistry)
Content copied to clipboard
Functions
Properties
activity
Link copied to clipboard
args
Link copied to clipboard
Fragment arguments set via Mavericks.KEY_ARG.