为什么不调用 onMenuOpened?

Why is onMenuOpened is not called?

一个应用程序通过以下方式隐藏操作栏:

    uiOptions =  View.SYSTEM_UI_FLAG_HIDE_NAVIGATION| View.SYSTEM_UI_FLAG_FULLSCREEN
            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
            | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
    //Hide both the status bar and navigation bar
    getWindow().getDecorView().setSystemUiVisibility(uiOptions);

触摸屏幕时,调用以下方法显示操作栏:

uiOptions = View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
        | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
        | View.SYSTEM_UI_FLAG_LAYOUT_STABLE;
decorView.setSystemUiVisibility(uiOptions);

除了点击三点后打开溢出菜单,activity 的 onMenuOpened 没有被调用,但菜单正常打开时,一切正常。

有人能解释一下吗?

可能this.

The reason that onMenuOpened() and onPanelClosed() are not called is that Activity's default implementations of those methods will try and init the framework Action Bar.