I have a module in my Android Studio project, which is a Java Library, in there I wrote a function like this:
private boolean titleIsNotEmpty(Event event){
return event.getTitle().trim().isEmpty();
}
But on isEmpty()
I get the following message:
Call requires API level 9 (current min is 1) Java.lang.String#isEmpty
Also when I try to use Function
or Optional
classes I get the same error:
Call requires API level 24 (current min is 1)
How can I define that on a Java Library?, my gradle build.module is:
apply plugin: 'java'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
Thanks in advance