Diamond operator is one of the new feature of Jdk 7. Please make sure you jdk version is 7 or not. Here is an example of diamond operator.
Here is an assignment statement :
Map<String, List<String>> anagrams = new HashMap<String, List<String>>();
With diamond operator :
Map<String, List<String>> anagrams = new HashMap<>();
Edit
Add that to your build.gradle
..
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 21
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
}
Hope it will be useful for you.