I want to use lambda expressions, for these two articles I took examples:
But in the end does not work.
I use java 8, android studio 1.
What else does he need, or what do I not understand?

I want to use lambda expressions, for these two articles I took examples:
But in the end does not work.
I use java 8, android studio 1.
What else does he need, or what do I not understand?

Install java 8, in the project structure, specify where your jdk 1.8 lies. Then in the gradle project add the following:
buildscript { repositories { jcenter() } dependencies { ............................................... classpath 'me.tatarka:gradle-retrolambda:3.2.0' } } After the gradle app add the following:
apply plugin: 'com.android.application' apply plugin: 'me.tatarka.retrolambda' android { .............................................. compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } Unfortunately, so far when writing applications for Android 1.8 is not available, so the lambda and other chips new jdk will not work.
If you want to use lambda in Android Studio, try gradle-retrolambda . It integrates a gradle tool that converts Java 8 bytecode to Java 6/7.
Source: https://ru.stackoverflow.com/questions/386584/
All Articles