我尝试在 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 英寸安卓平板电脑上工作吗?
谢谢!