What does onPrepareOptionsMenu do?
Take a look in the API: Prepare the Screen’s standard options menu to be displayed. This is called right before the menu is shown, every time it is shown. You can use this method to efficiently enable/disable items or otherwise dynamically modify the contents.