I have a simple Toolbar in my fragment. The Toolbar has a menu associated to it (overflow menu under the 3 dots icon) and everything works pretty well - I get my click events when one of the menu items is selected.
However, I need to do something when the initial settings menu is clicked, not when one of the menu items are selected. Any ideas how to do that? I'm not specifying the menu manually - just using the one inbuilt into the Toolbar so I can't just do a find and onClick...
My current toolbar code:
mUIToolbar = (Toolbar) view.findViewById(R.id.toolbar);
ActionBarActivity activity = (ActionBarActivity) getActivity();
activity.setSupportActionBar(mToolbar);
activity.getSupportActionBar().setDisplayShowTitleEnabled(false);
activity.supportInvalidateOptionsMenu();