当前位置:网站首页>2.8 overview of ViewModel knowledge
2.8 overview of ViewModel knowledge
2022-07-03 12:15:00 【schr03p】
One 、 Based on using

Belong to lifecycle Part of the component library
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.3.0-alpha05' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.0-alpha05'
Inherit viewmodel/ or androidViewModel
stay Activity/Fragment Use in
ViewModelProviders.of(getActivity()).get() by viewmodel
Life cycle auto sensing
onClear Callback functions handle resource recycling
closeWithRuntimeExceptionViewModel Never quote View、Lifecycle Or anything that may contain a pair of Activity Class referenced by context

be used for fragment Data sharing between
viewmodel+livedata+room Data perception , draw UI
边栏推荐
- Dart: self study system
- laravel 时区问题timezone
- Dart: About zone
- Groovy test class and JUnit test
- (数据库提权——Redis)Redis未授权访问漏洞总结
- Flutter 退出登录二次确认怎么做才更优雅?
- PHP get the file list and folder list under the folder
- [combinatorics] permutation and combination (example of permutation and combination)
- Vulnhub pyexp
- DEJA_VU3D - Cesium功能集 之 054-模拟火箭发射全过程
猜你喜欢
随机推荐
Summary of development issues
网络通讯之Socket-Tcp(一)
Use of atomicinteger
Use of QT OpenGL camera
OpenGL draws colored triangles
Duplicate numbers in the array of sword finger offer 03
ArcGIS application (XXI) ArcMap method of deleting layer specified features
win10 上PHP artisan storage:link 出现 symlink (): Protocol error的解决办法
4000 word super detailed pointer
CGroup introduction
OpenGL index cache object EBO and lineweight mode
[learning notes] DP status and transfer
Swagger
Shell: basic learning
laravel 时区问题timezone
Wechat applet development - page Jump transfer parameters
Momentum of vulnhub
Redis
Integer int compare size
Shardingsphere sub database and sub table < 3 >










