android.os.Build.VERSION_CODES javadoc 了解详情

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19906758/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 21:13:39  来源:igfitidea点击:

android.os.Build.VERSION_CODES javadoc for details

javaandroid

提问by user2979131

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.teoit.securenotes"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="15"
android:maxSdkVersion="15" />

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.teoit.securenotes.Smsm"
android:label="@string/app_name" >
<intent-filter>
<action android:name="com.teoit.securenotes.SMSM" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.teoit.securenotes.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>

</manifest>

The Problem Here ..

问题在这里..

    <uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="15"
android:maxSdkVersion="15" />

Tip problem

提示问题

Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.

不针对最新版本的 Android;兼容模式适用。考虑测试和更新此版本。有关详细信息,请参阅 android.os.Build.VERSION_CODES javadoc。

What is The Solution ?? :(

解决办法是什么 ??:(

回答by laalto

It's an Android Lint warning that tells that you should consider updating targetSdkVersionto the latest API level (19 as of now). It's because your target SDK level is lower than your build SDK (defined in project.properties on Eclipse/ADT-based tooling).

这是一个 Android Lint 警告,告诉您应该考虑更新targetSdkVersion到最新的 API 级别(截至目前为 19)。这是因为您的目标 SDK 级别低于您的构建 SDK(在基于 Eclipse/ADT 的工具上的 project.properties 中定义)。

When you run an app with a given target SDK version on a device actually running a higher API level, the platform enables certain backward-compatibility features. Instead you should ensure that your app works correctly without these features. The comptatibility modes are listed in the javadoc.

当您在实际运行更高 API 级别的设备上运行具有给定目标 SDK 版本的应用程序时,该平台会启用某些向后兼容功能。相反,您应该确保您的应用程序在没有这些功能的情况下正常运行。兼容性模式在javadoc中列出。

回答by user3107671

I had exactly the same problem.

我遇到了完全相同的问题。

The solution : Project-> Clean

解决方案:项目->清理

回答by MrB

simple, just do this

简单,做这个

...
android:targetSdkVersion="$$"
../>