RequiresFeature
public
abstract
@interface
RequiresFeature
implements
Annotation
androidx.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 | |
---|---|
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. |
String
|
name()
The name of the feature that is required. |
Inherited methods | |
---|---|
Public methods
enforcement
public 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.
Returns | |
---|---|
String |
name
public String name ()
The name of the feature that is required.
Returns | |
---|---|
String |