Thursday 12 November 2020

Why can't I define type="LiveData" in Android Studio?

Code A can work well, I don't know why Code b can't work, could you tell me ?

Code A

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>        
        <import type="androidx.lifecycle.LiveData" />

        <variable
            name="MyValue1"
            type="LiveData&lt;Integer>" />
    </data>
   ...

Code B

<layout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <data>        
        <import type="androidx.lifecycle.LiveData" />

        <variable
            name="MyValue2"
            type="LiveData&lt;Int>" />
    </data>
   ...


from Why can't I define type="LiveData<Int>" in Android Studio?

No comments:

Post a Comment