Restrict density in API 7
How can I restrict densit开发者_运维知识库y in Manifest in early version than API 9. As I know since this API there is a tag
<compatible-screens>
<screen android:screenSize=["small" | "normal" | "large" | "xlarge"]
android:screenDensity=["ldpi" | "mdpi" | "hdpi" | "xhdpi"] />
...
</compatible-screens>
But in early versions I can only restrict screen size with
<supports-screens android:smallScreens="false"
android:normalScreens="true" android:largeScreens="true"
/>
Thanks in advance,
You can simple set your target SDK
version to 9, and minSDK
version to whatever you want. This way the density will be restricted on devices with API version 9 and higher, and on devices with API version lower than 9 only the screen size parameter will be checked. AFAIK, there's no other way to resolve this problem.
精彩评论