检测点击动作条的溢出菜单按钮

检测点击动作条的溢出菜单按钮

本文介绍了检测点击动作条的溢出菜单按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我能察觉点击/水龙头上的操作栏,即用于显示溢出菜单项的菜单按钮。默认情况下,打开了单个项目的列表设置。这里是截图。到目前为止它是在2检测点击,但我想检测点击1

Can i detect click/tap on the menu button of action bar i.e. used to show overflow menu items. By default it opens up the list with one item "Settings". Here is the ScreenShot. Till now it is detecting click on "2" but I want to detect click on "1"

推荐答案

终于让我找到了解决办法。覆盖FragmentActivity.onKeyDown

Finally i found the solution. Override FragmentActivity.onKeyDown

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    // TODO Auto-generated method stub
    switch (keyCode) {

    case KeyEvent.KEYCODE_MENU:
        // Do Sometihng
        break;

    default:
        break;
    }
    return super.onKeyDown(keyCode, event);
}

这篇关于检测点击动作条的溢出菜单按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 20:39