gpt4 book ai didi

安卓 ICS : How to detect that a device have "on screen Back/Home button" (Like Galaxy Nexus)

转载 作者:塔克拉玛干 更新时间:2023-11-01 22:07:07 24 4
gpt4 key购买 nike

我想知道是否有办法检测设备是否有“屏幕按钮”(如 Galaxy Nexus 或 ICS 平板电脑)

我的问题是,在带有屏幕按钮的设备中,在操作中,添加了溢出按钮(如果溢出),而不是在其他设备上,所以我希望能够预测这种行为。

感谢您的帮助。

最佳答案

您可以从您的 Activity 运行以下命令:

boolean hasNavigationBar = false;

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH)
{
hasNavigationBar = !ViewConfiguration.get(context).hasPermanentMenuKey();
}
else
{
hasNavigationBar = false;
}

关于安卓 ICS : How to detect that a device have "on screen Back/Home button" (Like Galaxy Nexus),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9105361/

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