1

我确定它在stackoverflow上,我一直在搜索,但找不到。Which method is called when nothing in the optionsmenu is selected, but when it closes?

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

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {

而我少了一个...

谢谢!

4

2 回答 2

2

它称为onOptionsMenuClosed

@Override
public void onOptionsMenuClosed(Menu menu) {
    super.onOptionsMenuClosed(menu);
    //do your business
}
于 2012-04-05T12:54:28.753 回答
0

在我的情况下

  @Override
public void onPanelClosed(int featureId, Menu menu) {
  showingMenu = false;
  super.onPanelClosed(featureId, menu);
}
于 2015-04-23T10:52:56.093 回答