Posts /

Android 에서 Java8 lambda 표현식 사용하기

02 Dec 2017

기준

API Level 24미만

build.gradle

Project

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'me.tatarka:gradle-retrolambda:3.7.0'
    }
}

build.gradle

Module : app

apply plugin: 'me.tatarka.retrolambda'
 
android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

API Level 24 이상

build.gradle

Module : app

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

Twitter Facebook Google+