Chris Fillmore
05/06/2021, 2:41 PMLifecycleObserver
.
The Kotlin examples here use `@OnLifecycleEvent`: https://developer.android.com/topic/libraries/architecture/lifecycle#lc
However, this page (Java examples) says that annotations will be deprecated: https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle , and instead I should implement DefaultLifecycleObserver
What is the correct practice here? Thank you!Chris Fillmore
05/06/2021, 2:42 PMJeremy
05/06/2021, 2:59 PMDefaultLifecycleObserver
. To include it you should add "androidx.lifecycle:lifecycle-common-java8:<version>"
to your build.gradle file."