0

我尝试在 10 英寸平板电脑上运行目前支持安卓手机的代码。但是,该应用程序显示错误“此设备当前不支持应用程序”。我想知道如何让它工作?我尝试将 android:xlargescreen="false" > 切换为 true,但这也没有解决。这是我的 android manifest 代码:

 <supports-screens 
        android:anyDensity="true"
        android:resizeable="false"
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"

        />

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

此外,在我的启动活动中,如果设备不受支持,我会调用警报:

/**
     * This method was originally used to detect if the device is supported or not
     * The device detection has been moved to the Android Manifest XML file
     * supports-screens tag
     * @return boolean true if device is supported
     */
    private boolean isDeviceSupported() {
        if (!Application.getAppResources().getBoolean(R.bool.isDeviceSupported)) {
            AlertDialog.Builder builder = new AlertDialog.Builder(this);
            builder.setMessage(getResources().getString(R.string.device_not_supported)).setCancelable(false).setPositiveButton("Ok", new DialogInterface.OnClickListener() {
                public void onClick(DialogInterface dialog, int id) {
                    finish();
                }
            });
            AlertDialog alert = builder.create();
            alert.show();
            return false;
        } else {
            return true;
        }
    }


private void goToLoginActivity() {
        //Device detection has been moved to Android manifest XML file
        if (isDeviceSupported()) {
            LoginActivity.newInstance(this);
            finish();
        }
    }

有什么线索可以让它在我的 10 英寸安卓平板电脑上工作吗?

谢谢!

4

1 回答 1

0

在AndroidManifest.xml的 uses-permissions 和 features 中设置 required false ,例如:

 <uses-permission
        android:name="android.permission.CAMERA"
        android:required="false"/>

  <uses-feature
        android:name="android.hardware.camera"
        android:required="false"/>

  <uses-feature
        android:name="android.hardware.camera.autofocus"
        android:required="false"/>

编辑:

也尝试删除

android:resizeable="false"

已弃用(http://developer.android.com/guide/topics/manifest/supports-screens-element.html#resizeable),您可以删除所有块supports-screens,因为默认值为 true。

于 2013-10-17T15:18:22.240 回答