Display ActionMode over Toolbar

Since you are using the Toolbar, I also assume you are using the
AppCompatActivity and have replaced the built in ActionBar with
your custom Toolbar using setSupportActionBar(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);

Leave a Comment