Skip to content

Instantly share code, notes, and snippets.

@Chetan496
Created December 18, 2016 09:28
Show Gist options
  • Save Chetan496/e96089dd4dcf5eca96f60d416ab07a62 to your computer and use it in GitHub Desktop.
Save Chetan496/e96089dd4dcf5eca96f60d416ab07a62 to your computer and use it in GitHub Desktop.
Using lambda expressions in Android projects
To use lambda expressions, you just have to enable the jack toolchain in build.gradle of your module.
Open build.gradle for you app, and configure it as follows:
android {
...
defaultConfig {
...
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
### Note:
Jack toolchain can be used if buildToolsVersion is greater than 21.
Also a newer version of gradle is required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment