gpt4 book ai didi

android - 如何防止 Nexus7 从 layout-sw360dp 加载屏幕?

转载 作者:行者123 更新时间:2023-11-29 00:33:18 24 4
gpt4 key购买 nike

我正在开发一个仅适用于手机设备而非平板电脑的 android 应用程序。

我的应用适用于分辨率为 720x1280 且密度为 xhdpi 的 ICS 设备(例如:Galaxy S3、Galaxy Nexus、Xperia V 等)

如果我使用 layout-sw360dp,我该如何阻止/阻止 Nexus7 平板电脑加载我的应用程序屏幕?

或者如何限制应用只能在 720x1280 分辨率的手机设备上运行?

最佳答案

First get device widh and height and easily you can control this.

  Display display = getWindowManager().getDefaultDisplay(); 
int width = display.getWidth();
int height = display.getHeight();

System.out.println(width+" "+height);

if(height>720 && width>1280)
{
mainActivityrun();
}
else
{
finish();
}

关于android - 如何防止 Nexus7 从 layout-sw360dp 加载屏幕?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14108050/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com