我需要 Android API 级别 11 的功能,但如果我将 targetSdkVersion 设置为 10,那么我会得到我想要的旧式菜单(带有菜单按钮)。设置这些值是否“合法”,或者 targetSdkVersion 是否必须高于或等于 minSdkVersion?
(注:好像有用!)
最佳答案
作为document说到 android:targetSdkVersion
,
An integer designating the API Level that the application targets. If not set, the default value equals that given to minSdkVersion. This attribute informs the system that you have tested against the target version and the system should not enable any compatibility behaviors to maintain your app's forward-compatibility with the target version. The application is still able to run on older versions (down to minSdkVersion).
无论如何,targetSdkVersion
应该始终大于或等于 minSdkVersion
,因为您的应用绝不能在 minSdkVersion
以下运行。如果你设置的 targetSdkVersion
小于 minSdkVersion
这意味着你告诉 android 系统你已经在 targetSdkVersion
上测试了这个应用程序,但是这不可能(因为您的应用程序只能在低至 minSdkVersion
的设备上运行)。
因此矛盾 targetSdkVersion
应该总是大于等于 minSdkVersion
。
关于android - 我可以将 targetSdkVersion 设置为小于 minSdkVersion 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31935803/