Whats the difference between RequiresApi and TargetApi?
Sample in kotlin:
@RequiresApi(api = Build.VERSION_CODES.M)
@Target
From the JavaDocs in https://developer.android.com/reference/android/support/annotation/RequiresApi.html:
[@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.
I suppose they're functionally equivalent but @RequiresApi seems to be newer and has a higher chance of being extended to include more functionality.