Android Studio 使用Lambda
2017/9/27 10:54:05
在app下的build.gradle中添加
android {
...
defaultConfig {
...
android.compileOptions.sourceCompatibility 1.8
android.compileOptions.targetCompatibility 1.8
}
compileOptions{
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
测试
new Thread(() -> {
Log.d(TAG, "onCreate: " + "Lambda 测试");
}).start();