Kotlin-android: unresolved reference databinding

后端 未结 16 1108
借酒劲吻你
借酒劲吻你 2020-12-02 16:23

I have following fragment class written in Java using the new databinding library

import com.example.app.databinding.FragmentDataBdinding;

public class Data         


        
16条回答
  •  旧时难觅i
    2020-12-02 17:05

    I want to share my own expirience. To use data databinding with Kotlin in android studio is enough to add

    dataBinding {
        enabled = true
    }
    

    After that "sync it" and, it's very important, to "make Project". After that all your object will be active to use.

提交回复
热议问题