I am getting this by default
I want this
This should be trivial enough but I can't find anything related on Android docs.
private void setupContextualBar()
{
mActionModeCallback = new ActionMode.Callback()
{
// Called when the action mode is created; startActionMode() was called
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu)
{
MenuInflater inflater = getActivity().getMenuInflater();
inflater.inflate(R.menu.my_menu , menu);
mCABMenu = menu;
return true;
}
// Called each time the action mode is shown. Always called after onCreateActionMode, but
// may be called multiple times if the mode is invalidated.
@Override
public boolean onPrepareActionMode(ActionMode mode, Menu menu)
{
updateContextualBar();
return true;
}
// Called when the user selects a contextual menu item
@Override
public boolean onActionItemClicked(ActionMode mode, MenuItem item)
{
int menuItemId = item.getItemId();
boolean eventConsumed = false;
switch (menuItemId)
{
//handle cases here
}
if (eventConsumed)
{
updateContextualBar();
}
return eventConsumed;
}
// Called when the user exits the action mode
@Override
public void onDestroyActionMode(ActionMode mode)
{
mActionMode = null;
}
};