阅读832 返回首页    go 阿里云 go 技术社区[云栖]


如何让有物理键的手机在ActionBar始终显示更多菜单menu键

仅作记录代码用,功能未能测试成功,在低版本上不存在 sHasPermanentMenuKey 属性,会出现 java.lang.NoSuchFieldException: sHasPermanentMenuKey 异常




        try {
            ViewConfiguration config = ViewConfiguration.get(this);
            Field menuKeyField = ViewConfiguration.class.getDeclaredField("sHasPermanentMenuKey");
            if (menuKeyField != null) {
                menuKeyField.setAccessible(true);
                menuKeyField.setBoolean(config, false);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }


最后更新:2017-04-03 12:55:38

  上一篇:go 关于Ubuntu 下新开发板adb 无法识别的问题(成功案例:解决了三星,索爱,OPPO X903案例)
  下一篇:go 今日成为CSDN认证专家