Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

AndroidViewModel

open class AndroidViewModel : ViewModel
kotlin.Any
   ↳ androidx.lifecycle.ViewModel
   ↳ androidx.lifecycle.AndroidViewModel

Application context aware ViewModel.

Subclasses must have a constructor which accepts Application as the only parameter.

Summary

Public constructors
<init>(@NonNull application: Application)

Public methods
open T

Return the application.

Inherited functions

Public constructors

<init>

AndroidViewModel(@NonNull application: Application)

Public methods

getApplication

@NonNull open fun <T : Application!> getApplication(): T

Return the application.