当前位置: 动力学知识库 > 问答 > 编程问答 >

android - ActionBar OverflowMenu item disappears on click

问题描述:

I have an ActionBar with overflow menu items. Each item's onClick starts an Activity using an Intent. In some devices, the item text disappears and the menu remains stuck until the activity opens.

I think that it waits for the Activity to open. Is there anyway to force the overflow menu to close immediately instead of seeing the menu with an empty text entry?

网友答案:

I had the same error, what solved this for me is really simple: close the menu :)

  @Override
    public boolean onMenuItemSelected(int featureId, MenuItem item) {

        closeOptionsMenu();

        .....
        .....        
        .....
        return .....;
    }
分享给朋友:
您可能感兴趣的文章:
随机阅读: