Explain difference between onCreateOptionsMenu(Menu menu)
and onPrepareOptionsMenu(Menu menu)
.
onCreateOptionsMenu()
is called once.onPrepareOptionsMenu()
is called every time the menu opens.
From the onCreateOptionsMenu()
documentation:
This is only called once, the first time the options menu is displayed. To update the menu every time it is displayed, see
onPrepareOptionsMenu(Menu)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With