答案 0 :(得分:2)
您不必将点击listener
设置为菜单。只需override
以下方法。
//Called on you open menu. or when you click on menu the three dots.
@Override
public boolean onMenuOpened(int featureId, Menu menu) {
Toast.makeText(this, "Open", Toast.LENGTH_SHORT).show();
return true;
}
你也可以覆盖它以检测关闭:
// Called when you close (ie. by clicking outside etc)
@Override
public void onPanelClosed(int featureId, Menu menu) {
Toast.makeText(this, "closed", Toast.LENGTH_SHORT).show();
}