I have an activity with an app bar and a navigation drawer. The app bar is implemented using the new Toolbar class from appcompat-v7 library version 21.+, and the navigation
I might have found a solution - or perhaps a simple workaround.
I had the same problem even with a ListFragment, when startActionMode()
was used instead of the built-in setChoiceMode()
.
So I looked into ListFragment code and I found that startActionMode()
is not called on the activity but rather on its ListView, so I've tried using a view.
In my code now it apparently works as expected using either the fragment ListView:
ActionMode mActionMode = getListView().startActionMode(this);
or using the Activity container that contains my fragment:
View aView = getActivity().findViewById(R.id.container);
ActionMode mActionMode = aView.startActionMode(this);
Also:
windowActionModeOverlay
in my style was covering only part of it - at least in my caseTo be honest I'm not sure about the reasons behind this, so I'm not sure how safe this solutions is, however for the time being seems to work fine.
Should anyone have a better understanding please feel free to comment or edit.