Android: onOptionItemSelected set items Visible.GONE
<p>I have a search item, with 2 other items on the toolbar.</p>

<p>On clicking on the search item, I wish for the other 2 items to disappear and reappear when the search bar is closed.</p>

<p>Here is what i have tried thus far:</p>

<pre><code>@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    super.onCreateOptionsMenu(menu, inflater);

    inflater.inflate(R.menu.actions_one_fragment, menu);

    final MenuItem item = menu.findItem(R.id.action_search);
    this.menu = menu;
    final SearchView searchView = (SearchView) MenuItemCompat.getActionView(item);
    searchView.setOnQueryTextListener(this);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    FragmentActivity activity = getActivity();
    switch (item.getItemId()) {
        case R.id.action_search:
            menu.findItem(R.id.action_item_one).setVisible(false);
            menu.findItem(R.id.action_item_two).setVisible(false);
        default:
            return super.onOptionsItemSelected(item);
}
</code></pre>

<p>This doesn't do anything.</p>