-
You can have the presenter be a subclass of the ViewModel class and update data on the ui with the help of LiveData.
If you think it's a good idea I'd like to work on it.
-
Your Turn: The DetailActivityViewModel
4. Open ui.detail.DetailActivity. Have DetailActivity extend LifecycleActivity instead of AppCompatActivity.
is there any activity name LifecycleActivity?
-
https://boybeak.github.io/2021/03/12/2022-09-17-Jetpack%E4%B9%8BLifecycle%E6%BA%90%E7%A0%81%E5%88%86%E6%9E%90/
这是一篇解析jetpack库中的Lifecycle库的分析文章。
12345def lifecycle_version = "2.2.0"// Life…
-
[Project Files](https://github.com/eucalypto/learn/tree/main/android%20codelabs/kotlin-unscramble-app)
[Architecture Components Pathway](https://developer.android.com/courses/pathways/android-basic…
-
As documented here: https://developer.android.com/topic/libraries/architecture/viewmodel.html
> [...] However ViewModel objects must never observe changes to lifecycle-aware observables, such as Li…
-
Inregrating ViewModel with Activities/Fragments.
The Screens need to be configuration aware before getting destroyed. ViewModel and LiveData need to be integrated.
-
LifecycleActivity has been deprecated since `android.arch.lifecycle` libs are stable version.
Fourth step in introduction to ViewModels can be removed
-
Hi,
I've been trying to access viewmodel and livedata in my views using Magellan but it don't work.
Am I missing something?
I tryed to access the ViewModel this way
`MyViewModel = ViewModel…
-
如果数据源的LiveData不在ViewModel里, 那么configChange以后, Activity重建后, 也无法从ViewModel里获取到数据, 还要重新请求. 直接通过ViewModel来调用Repository通过LiveDataBus发送数据感觉和MVP的思想是一样的. ViewModel里并没有保存数据啊
ukyo6 updated
3 years ago
-
Duplicate class android.arch.lifecycle.AndroidViewModel found in modules extensions-1.0.0-runtime (android.arch.lifecycle:extensions:1.0.0) and viewmodel-1.1.0-runtime (android.arch.lifecycle:viewmode…