Adding LiveData to the project
If you check out your app's
build.gradle
file, you can find the following code:
// architecture components
implementation
"androidx.arch.core:core-common:$androidx_common"
implementation
"androidx.lifecycle:lifecycle-common:$lifecycle_components"
implementation
"androidx.lifecycle:lifecycle-extensions:$lifecycle_components"
By adding the
core
and
lifecycle
dependencies, you add some of Android Jetpack's
fundamental components, which are related to the Android lifecycle. This also
includes the
LiveData
component, so you can use it, without changing anything.
Saving Data on Android Chapter 9: Using Room with Google's Architecture Components
raywenderlich.com
151
Now, open
Do'stlaringiz bilan baham: |