Whats the difference between RequiresApi and TargetApi?
RequiresApi
TargetApi
Sample in kotlin:
@RequiresApi(api = Build.VERSION_CODES.M) @Target
@RequiresApi - Denotes that the annotated element should only be called on the given API level or higher.
@RequiresApi
@TargetApi - Indicates that Lint should treat this type as targeting a given API level, no matter what the project target is.
@TargetApi