91

Android Architecture Component 解析之 ViewModel - 简书

 6 years ago
source link: https://www.jianshu.com/p/7505f79b3ae3?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
概览 ViewModel 主要用于在已知界面的生命周期的背景下,存储以及管理UI相关的数据。ViewModel类可以在配置信息改变(configuration change)的情况下(例如屏幕的旋转)保持数据状态。 众所周知的是,Android系统框架管理着UI控制器(Activity / Fragment)的生命周期。出于对用户行为以及设备事件的响应,系统可能会销毁或重建UI控制器,而这些...

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK