硬件菜单按钮无法打开,在三星GALAXY Tab 3 [英] Hardware menu button not opening in Samsung galaxy tab 3

查看:111
本文介绍了硬件菜单按钮无法打开,在三星GALAXY Tab 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个三星Galaxy TAB3,我必须以通常的方式来实现菜单 - 即

I have a samsung galaxy tab3 and I have the menu implemented in the usual manner - i.e.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.game_menu, menu);
    return true;
}

和为菜单中选择

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle item selection
    switch (item.getItemId()) {
    case R.id.new_game:
        newGame();
        return true;
    case R.id.help:
        showHelp();
        return true;
    default:
        return super.onOptionsItemSelected(item);
    }
}

在我的XML香港专业教育学院使用安卓showAsAction =从不的,我希望看到的溢出物项和安卓showAsAction =ifRoom 因为我想看到的前期项目。但在这片我只看到了那些与ifRoom集和其他人只是消失和菜单按钮不会显示溢出的项目。我看了看,因此所有的答案,并试图流行的,如设置最小和目标SDK版本低于11 等。但菜单只是不会出现。它工作正常,在不具备电容式触控菜单和溢流按钮显示在操作栏中的设备。

In my xml ive used android:showAsAction="never" for items that I want to see in overflow and android:showAsAction="ifRoom" for items I want to see upfront. But in this tablet I see only the ones with ifRoom set and the others just disappear and the menu button does not show the overflow items. I've looked at all answers on SO and tried the popular ones like setting minimum and target sdk versions to less than 11 and so on. But the menu just wont come up. It works fine in devices that dont have the capacitive menu touch and an overflow button is shown in the action bar.

推荐答案

那么它结束了,当我编程名为 openOptionsMenu 与合作的onkeydown

Well it ended up working when I programmatically called openOptionsMenu with onKeyDown

@Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {

         if (keyCode == KeyEvent.KEYCODE_MENU) {
            openOptionsMenu();
        }
        return true;
    };

这篇关于硬件菜单按钮无法打开,在三星GALAXY Tab 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆