通过这里的其他帖子和android文档,我添加<compatible-screens>
了我的android清单文件,以将我的应用程序仅限制为手机。但是,每当我尝试在Nexus 7平板电脑上运行该应用程序时,该应用程序就会显示在平板电脑上。以下是我的android清单文件。我有什么想念的吗?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.myapp.testapplication" >
<uses-permission android:name="android.permission.READ_CONTACTS" />
<compatible-screens>
<!-- all small size screens -->
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<!-- all normal size screens -->
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
</compatible-screens>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
但是,每当我尝试在Nexus 7平板电脑上运行该应用程序时,该应用程序就会显示在平板电脑上
当然。如果您正在设备上手动运行该应用程序,它将运行。
引用文档:
Android系统不会读取
<compatible-screens>
清单元素(无论是在安装时还是在运行时)。此元素仅供参考,外部服务(例如Google Play)可以使用此元素来更好地了解应用程序与特定屏幕配置的兼容性并为用户启用过滤。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句