android - 是否有@minApi注释,类似于Android中的@TargetApi注释?

标签 android android-annotations

int API_VERSION = 21;

@TargetApi(API_VERSION) 在 Android 中用于指定 API_VERSION 及以下版本支持该方法/类。

我们可以镜像类似的内容来指定仅 API_VERSION 及以上版本支持方法或类吗?

注意:- 我没有找到任何此类注释,但想询问社区是否遇到过类似的情况或实现了自己的注释?

最佳答案

@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 @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.

关于android - 是否有@minApi注释,类似于Android中的@TargetApi注释?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39732150/

相关文章:

java - 简化三重嵌套循环以避免 android Retrofit2 中的回调 hell (通过 RxJava2?)

iphone - Titanimum Mobile 应用本地化

android - Gradle 找不到 list 文件

AndroidAnnotations Rest 查看响应数据

ListActivity 中的 AndroidAnnotations 和上下文菜单

java - 有什么办法可以用这种方式替换这段代码吗?

java - 仅在横向模式下强制旋转屏幕卡住

android - DiffUtil 和 notificationItemInserted 之间的区别

android - 检查或不检查 "IsLibrary"?

java - 带有 AndroidAnnotations NoClassDefFoundError 的 Android Studio