问题描述:

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 .....;
    }
相关阅读:
Top