Package 

Annotation RequiresApi

  • All Implemented Interfaces:
    java.lang.annotation.Annotation

    @Retention(value = )@Target(value = {}) 
    public @interface RequiresApi
    
                        

    Denotes that the annotated element should only be called on the given API level or higher.

    This is similar in purpose to the older {@code @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 {@code minSdkVersion}.

    • Method Summary

      Modifier and Type Method Description
      abstract int value() The API level to require.
      abstract int api() The API level to require
      • Methods inherited from class java.lang.annotation.Annotation

        annotationType, equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • value

         abstract int value()

        The API level to require. Alias for api which allows you to leave out the {@code api=} part.

      • api

         abstract int api()

        The API level to require