应用程序快捷方式:minSdk<25 的 Lint 警告

App Shortcuts: Lint warning with minSdk<25

我知道在旧的 API 中可以安全地忽略这些新属性。现在有没有什么办法可以让下面的 Lint 警告消失而不抑制它或提高 minSdk?

Attribute shortcutId is only used in API level 25 and higher (current min is 15) less... (Ctrl+F1) This check finds attributes set in XML files that were introduced in a version newer than the oldest version targeted by your application (with the minSdkVersion attribute). This is not an error; the application will simply ignore the attribute. However, if the attribute is important to the appearance or functionality of your application, you should consider finding an alternative way to achieve the same result with only available attributes, and then you can optionally create a copy of the layout in a layout-vNN folder which will be used on API NN or higher where you can take advantage of the newer attribute. Note: This check does not only apply to attributes. For example, some tags can be unused too, such as the new element in layouts introduced in API 21.

找到答案(我等了 90 分钟才 post 这个问题 SO..):

使用xml-v25\shortcuts.xml(而不是默认的xml\文件夹)