How to open the options menu programmatically?

前端 未结 11 1654
时光说笑
时光说笑 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:17

    if using AppCompatActivity

    getSupportActionBar().openOptionsMenu();
    

提交回复
热议问题