Refactored the onOptionsItemSelected method.
Resolved conflict in the onOptionsItemSelected method.