AndroidViewModelKt


public final class AndroidViewModelKt


Summary

Public methods

static final @NonNull Application

The underlying Application inside AndroidViewModel

Public methods

public static final @NonNull Application getApplication(@NonNull AndroidViewModel receiver)

The underlying Application inside AndroidViewModel

One common hierarchy, such as KotlinViewModel <: JavaViewModel <: AndroidViewModel, exposes private property application incorrectly. It is now fixed in K2 (Kotlin language version 2.0), but not backward compatible. This inline extension will make compilations of both pre- and post- 2.0 go well.