配置lambda
===========
添加
apply plugin:
'me.tatarka.retrolambda'
添加
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
build.gradle中的buildscript->dependencies节点中添加如下代码
classpath
'me.tatarka:gradle-retrolambda:3.2.0'
编写测试代码
textView.setOnClickListener { v -> Toast.makeText(applicationContext, "Lambda", Toast.LENGTH_LONG).show() }
========
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha