当前位置:网站首页>Can't find the activitymainbinding class? The pit I stepped on when I just learned databinding

Can't find the activitymainbinding class? The pit I stepped on when I just learned databinding

2022-07-05 09:13:00 Meng Meng Mu Xi

One 、Databinding Use

stay build.gradle In the open databinding Use

android {
    //  Copy the following three lines 
    dataBinding{
        enabled = true
    }
}

Two 、 Can't find ActivityMainBinding class

Just started to follow the video , It was found that... In the video could not be found ActivityMainBinding class ...

Finally, I found that my order was wrong , In the interface xml Change the root layout to layout, And set one of them variable.

3、 ... and 、 Problem solving

after ActivityMainBinding And that's what happened , And can automatically import packages

 

原网站

版权声明
本文为[Meng Meng Mu Xi]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202140538292714.html