Thứ Tư, 16 tháng 4, 2014

Android – Always show the overflow menu

If you want the menu always show, put the following lines to onCreate method of your Activity class.

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


Source: http://stackoverflow.com/a/11438245
- Comments

0 nhận xét:

Đăng nhận xét