zoukankan      html  css  js  c++  java
  • 【转】Android程序右上角不显示3个点的菜单

    最近换了一个安卓PDA,发现之前的程序,界面上右上角的选项菜单不见了。

    在网上查了一下,找到了解决方案,记录一下。

    代码如下所示,添加一个makeActionOverflowMenuShown()方法,在onCreate方法里调用一下。亲测对我有用。

    @Override  
        protected void onCreate(Bundle savedInstanceState) {  
            super.onCreate(savedInstanceState);  
            makeActionOverflowMenuShown();  
            setContentView(R.layout.activity_main);  
        }  
    private void makeActionOverflowMenuShown() {  
            //devices with hardware menu button (e.g. Samsung Note) don't show action overflow menu  
            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) {  
      
            }  
        }  

    原文链接:https://blog.csdn.net/u011068702/article/details/50023741

  • 相关阅读:
    discuz制作
    Cookie和Session专题
    ecmall二次开发 直接实例化mysql对象
    ecmall widgets 挂件开发详解
    都是iconv惹的祸
    discuz+ecmall+phpcms整合
    replace into
    权限管理设计二
    权限管理设计一
    SVN服务器搭建和使用(二)
  • 原文地址:https://www.cnblogs.com/luqingfei/p/14362750.html
Copyright © 2011-2022 走看看