Using LiveData with Data Binding

后端 未结 4 542
情书的邮戳
情书的邮戳 2020-12-28 14:28

With the stabilization of Android Architecture Components I started updating all my basic ViewModels to the new implementation ofViewModel. In my understanding,

4条回答
  •  情歌与酒
    2020-12-28 14:51

    The Android Studio 3.1 (currently in Canary 6) will fix this issue, since LiveData can be used as observable field:

    Updates to Data Binding:

    You can now use a LiveData object as an observable field in data binding expressions. The ViewDataBinding class now includes a new setLifecycle method that you need to use to use to observe LiveData objects.

    Source: Android Studio 3.1 Canary 6 is now available

提交回复
热议问题