I tried to find an answer about this, but no luck. I have a snippet that has a menu item called "menu_roi_result_calc". Each time you rotate the screen, a new menu item is created. The code is shown below:
@Override public boolean onCreateOptionsMenu(Menu menu) {
However, after a few turns of the screen, this is what I get:

It seems to me that this is due to the fact that menu items are recreated with each rotation, so every time a rotation occurs, a new element is added. How can I stop this? How can I check if there is an element and not recreate it again? Any code sample is greatly appreciated.
source share