android - @TargetApi(Build.VERSION_CODES.GINGERBREAD) android中的这段代码表示什么

标签 android

我正在 eclipse 中开发一个 android 应用程序。我的 ide 显示了生成此行的提示。我将其添加到我的代码中:

@TargetApi(Build.VERSION_CODES.GINGERBREAD) 

此代码表示什么?仅 GINGERBREAD 版本会限制该应用程序吗?

最佳答案

表示 Lint 应该将此类型视为针对给定的 API 级别,无论项目目标是什么(它只是抑制 Lint 错误)

通过 Android documentation

例如如果 Lint 检测到您使用的东西比您的 android:minSdkVersion 更新,但达到 API 级别 GingerBread,Lint 不会提示。

关于android - @TargetApi(Build.VERSION_CODES.GINGERBREAD) android中的这段代码表示什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17762402/

相关文章:

android - Eclipse ADT : Project name "appcompat_v7" being created after creating every new project

java - 如何从 Crashlytics 中检测崩溃原因?

android - Jetpack 中是否有类似颤动的热重载?

android - 将 Double 的 SparseArray 写入 Parcel

android - 我的 ScrollView 根本不起作用

android - 如何显示加载对话框

Android RSS 阅读器(忍者错误)

java - Android Dagger 2 不在 java/kotlin 项目中生成组件

安卓 : Create a single task with multiple applications' activities (Lauchmode issue)

java - 如何获取android :name from <application>