How to open the options menu programmatically?

前端 未结 11 1603
时光说笑
时光说笑 2020-11-28 06:47

I would like to open the optionsMenu programmatically without a click on the menu key from the user. How would I do that?

11条回答
  •  [愿得一人]
    2020-11-28 07:04

    from an OnClickListener inside an activity called MainActivity:

    MainActivity.this.openOptionsMenu();
    

提交回复
热议问题