【发布时间】:2019-08-06 14:36:09
【问题描述】:
有房道如下,
@Dao
public abstract class AccountDao {
@Query("SELECT * FROM Account LIMIT 0,1")
public abstract Account readAccount();
}
下面的示例中get() 和by lazy 之间有什么区别吗?
open val account: LiveData<Account>
get() = accountDao.readAccount()
open val account: LiveData<Account> by lazy { accountDao.readAccount() }
【问题讨论】:
标签: kotlin android-room android-livedata