Questions tagged [contextual-action-bar]

The contextual action bar (CAB) is a temporary action bar that overlays the app's current action bar while data is selected. It appears after the user long-presses on a selectable data item.

The contextual action bar from the platform was introduced in API level 11(Honeycomb) to provide a new way to show contextual actions for selected content instead of the traditional context menu. Although it was introduced in the SDK starting with Honeycomb the contextual action bar is available to lower API versions thanks to various libraries(like the ActionBarSherlock library). The contextual action bar should be preferred to the old context menu because it offers a richer and better user experience. More information about the contextual action bar can be found in:

219 questions
3
votes
1 answer

Contextual actionbar with listview, setselected not working

I'm trying to make a contextual ActionBar. I used the sample from the android devpage, but i still haven't got it to work. I set an eventlistener on onitemlongclick, but the setSelected(true) doesn't seem to do anything. I know that the event is…
3
votes
2 answers

onContextItemSelected called twice for fragment

My app has a ListView and I'm using a Contextual Action Bar for devices above SDK 11 and the old popup contextual actions for older devices. I know there's a way to use a CAB with older devices but I tried to implement it and found it wasn't worth…
3
votes
1 answer

Contextual Action Bar Text change for "DONE" button in Android

I have CAB menu in my application. I have a requirement to change the text on "DONE" button to "ADD". How can I do that? I am able to see the design elements.But not for my requirement.
intrepidkarthi
  • 3,104
  • 8
  • 42
  • 75
3
votes
2 answers

ListView CAB Checked item coloring

I'm at a loss because I feel like android should be taking care of this default selection behavior... I'm using actionbarsherlock with a listview and have a contextual action bar appearing after an item long click. I want the items to appear…
joepetrakovich
  • 1,344
  • 3
  • 24
  • 42
3
votes
4 answers

Android - Action Bar Style

I want to show Action Bar like below. I have already used this library clickhere But it takes only two icons on Action Bar. If I add four items, then last two are shown me like menu. I want all in Action bar same as image above. Is it…
user1381827
3
votes
2 answers

Passing id of ListView item to ActionMode.Callback object

So my problem right now is that right now I am long clicking an item in a ListView which brings up a contextual action bar. The id passed into onItemLongClick is the variable that I would like to use in the mActionModeCallback's on…
joeschmidt45
  • 1,932
  • 2
  • 17
  • 20
2
votes
3 answers

How to change status bar color on entering contextual action mode

My application uses the app theme that inherits Theme.MaterialComponents.Light.NoActionBar. When user selects a list item and enters the contextual action mode, I want to change the action bar to dark grey color. I am using following code to achieve…
2
votes
1 answer

startSupportActionMode() throws NullPointerException

I am calling startSupportActionMode() inside an AppCompatActivity. This activity is created by clicking "Basic Activity" in Android Studio. It uses AppBarLayout and ToolBar to create ActionBar. Here is my Activity: import…
2
votes
5 answers

How to highlight or check selected list items

How should I go about implementing Java or XML code for highlighting (or showing a checkbox over) a list row or grid item in Multiple-Choice Modal mode in Android for use with a contextual action bar? I have implemented the contextual action bar…
2
votes
2 answers

remove back/home button from action mode on long press in android

I have implemented contextual action mode on long press inside recycler view. For that i have called ActionModeCallback from creating action mode . While creating action mode , back arrow is showing by default . Check below : On click back arrow…
2
votes
0 answers

Android Contextual Action Bar (CAB) backgroundSplit attribute not working

I am assuming the backgroundSplit attribute controls what is shown as the orange line on the bottom of the CAB: When I go to style my CAB and change the background color, the backgroundSplit disappears. styles.xml