diamond operator is not supported
This question already has an answer here:
Android needs java source compliance 5.0 or 6.0 (Java5/6). Java7 is not supported out of the box. The're articles describing hacks on how to use some of java7 features: http://www.informit.com/articles/article.aspx?p=1966024.
Also see Java 7 language features with Android, Does Android plan to support Java7?, Can the Android SDK work with JDK 1.7?.
API 19 KitKat Diamonds are now allowed. Below are Gradle edits needed to implement for Android Studio. Also make sure you are using JDK 1.7 and Gradle plugin later than 0.6.1
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 19
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
Android doesn't support 1.7 compilation level at this moment. So, you can't use diamond operator. You could fix this for java application by changing JRE to 1.7, but won't work with Android.
链接地址: http://www.djcxy.com/p/17968.html下一篇: 钻石操作员不受支持