JetPack
linghaoDo
不逼自己一把,永远不知道自己的潜力有多大!
展开
-
全方位解析liveData工作原理以及使用方法
1. 简介LiveData是一个抽象类,MutableLiveData是其用的比较多的子类,在MutableLiveData中只是吧postValue和setValue方法的限制符改为public,以此来防止数据的混淆MediatorLiveData是liveData的聚集管理者。通过其来实现统一管理和中转。mVersion 是一个同步标志类,liveData在做分发的时候,通过这个mVersion来控制是否应该进行数据的分发。特性确保UI符合数据状态不需要手动处理数据保持最新 的数据原创 2020-10-18 16:56:54 · 1360 阅读 · 0 评论 -
android JETPACK组件之ROOM
1. Room注解@interface Dao The class marked with {@code @Dao} should either be an interface or an abstract class. At compile time, Room will generate an implementation of this class when it is referenced@interface Database Marks a class as a RoomDatabase@原创 2020-10-09 10:17:23 · 200 阅读 · 1 评论