RequiresFeature

@Retention(value = SOURCE)  @Target(value = ) annotation RequiresFeature


Denotes that the annotated element requires one or more features. This is used to auto-generate documentation, and more importantly: to ensure correct usage in application code, where lint and Android Studio can check that calls marked with this annotation is surrounded by has-feature calls, referenced via the enforcement attribute.

Summary

Public methods

abstract @NonNull String

Defines the name of the method that should be called to check whether the feature is available, using the same signature format as javadoc.

abstract @NonNull String

The name of the feature that is required.

Public methods

enforcement

@NonNull
public abstract String enforcement()

Defines the name of the method that should be called to check whether the feature is available, using the same signature format as javadoc. The feature checking method can have multiple parameters, but the feature name parameter must be of type String and must also be the first String-type parameter.

name

@NonNull
public abstract String name()

The name of the feature that is required.