I am trying to use the android.view.ActionMode with the new android.support.v7.widget.Toolbar, in addition to the traditional android.app.Act
So, after days going thru this thread, I finally got it working. I'd like to summarize what I did.
Note: This is the solution using a
Toolbarto replace the defaultActionBarinAppCompatActivity.
AppTheme: It tells android that you want your action mode to overlay the toolbar- true
You have to use these imports in order to work with AppCompatActivity:
import androidx.appcompat.view.ActionMode;
// or
import android.support.v7.view.ActionMode;
actionMode = startSupportActionMode(callback);
And not like so:
actionMode = startActionMode(callback);
You Activity creates the ActionMode on the toolbar automatically, because it's set as the supportActionToolbar. The style handles the dsiplaying as overlay.
Thanks to @Kuffs and @Lefty.