@Retention(value=CLASS)
@Target(value={TYPE,METHOD,CONSTRUCTOR,FIELD,PACKAGE})
public @interface RequiresApi
This is similar in purpose to the older @TargetApi
annotation, but more clearly
expresses that this is a requirement on the caller, rather than being used to "suppress" warnings
within the method that exceed the minSdkVersion
.
public abstract int value
api()
which allows you to leave out the api=
part.