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
Since you are using the
Toolbar, I also assume you are using theAppCompatActivityand have replaced the built inActionBarwith your customToolbarusingsetSupportActionBar(toolbar);
First of all ensure you are importing the correct namespace:
import androidx.appcompat.view.ActionMode;
// Or
import android.support.v7.view.ActionMode;
and NOT
import android.view.ActionMode;
then use
_actionMode = startSupportActionMode(this);
and NOT
_actionMode = startActionMode(this);