Android: launch onCreateOptionsMenu

How can I run the Android onCreateOptionsMenu function in my code, that is, without clicking on the options menu button on the phone?

+6
source share
2 answers

Activity.openOptionsMenu(); doing the trick

+10
source

Name it yourself, for example, in onCreate() . However, there is a problem, you cannot pass the options menu because parent activity does not make it available.

-2
source

Source: https://habr.com/ru/post/904342/


All Articles