且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Android数据绑定:& quot;使用'的方法引用.'已弃用"

更新时间:2023-11-15 08:05:10

我的猜测是显示已弃用警告,因为Android数据绑定当前与Java 8不完全兼容.将以下内容放入项目的 build.gradle 文件中,将会隐藏所提及的警告.

My guess is that the deprecation warning is shown because Android Data Binding is currently not being fully compatible with Java 8. Putting the following into your project's build.gradle file should hide mentioned warning.

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }
}

除非您在项目中使用Java 8功能.

Unless you are using Java 8 features in your project.