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
43
votes
3 answers

How to close an ActionMode menu programmatically on Honeycomb?

In my application there is a ListFragment where each item from the list contains a checkbox. Whenever the user clicks on one of those checkboxes the app starts an ActionMode context menu. But I want the application to close the ActionMode menu when…
40
votes
3 answers

Custom cut/copy action bar for EditText that shows text selection handles

I have an app where I want to be able to show a TextView (or EditText) that allows the user to select some text, then press a button to have something done with that text. Implementing this on Android versions prior to Honeycomb is no problem but on…
Clyde
  • 7,389
  • 5
  • 31
  • 57
27
votes
2 answers

Overriding the default Contextual Action Bar for text selection(in WebView) in Android

I want to override the existing default Contextual Action Bar(CAB) for text selection. I mean, I want to display my own CAB, with my own buttons, when some text is selected on the webview. I tried implementing a CAB using Android Documentation.…
arun8
  • 1,191
  • 2
  • 14
  • 26
27
votes
2 answers

How can you implement multi-selection and Contextual ActionMode in ActionBarSherlock?

How should I implement multi selection on AdapterView with ActionBarSherlock, because it does not provide MultiChoiceModeListener? This is what it looks like How can you do this?
25
votes
6 answers

Android compatibility contextual action bar

In trying to follow the Android Design Guidelines, I'm running into a small quandary. I want to have a list of items that I can long-press several of (multi-select), and then perform bulk actions on them. The Design Guidelines suggest using the…
Paul
  • 35,689
  • 11
  • 93
  • 122
25
votes
1 answer

How to make the Contextual ActionMode Bar overlay the appcompat-v7 Toolbar but not the navigation drawer?

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 drawer is displayed in front of it. The activity contains a list view with…
24
votes
1 answer

How to correctly handle action mode "done" button?

Possible Duplicate: How to invoke the ActionBar's ContextMenu-like behavior? How to recognize whether the Done button is clicked in ActionMode How to correctly handle action mode "done" button? I perform some operations on an object in the action…
23
votes
4 answers

Contextual Actionbar styles

I'm looking for style information on the Contextual Action bar (CAB). I just need to change the colour of the text in fact.. As you can see from the above, this is using the standard Theme.Holo.Light.DarkActionBar theme, so I just need to set the…
Eurig Jones
  • 8,226
  • 7
  • 52
  • 74
21
votes
3 answers

Change Status Bar color when entering Contextual Action Mode

I have an application that uses theme attribute (colorPrimaryDark) to color the Status Bar on Android v21+: This is working fine. Now, when user long-presses a list item and enters the contextual action mode, I am able to color the CAB bar using…
Greg Ennis
  • 14,917
  • 2
  • 69
  • 74
17
votes
3 answers

How to invoke the ActionBar's ContextMenu-like behavior?

In Android 3.0, when you select some text for example, the ActionBar switches to a ContextMenu-like mode, which enables you to do actions with the selected text: copy/share/etc, and a "Done" button appears on the left side to enable the user to…
Zsombor Erdődy-Nagy
  • 16,864
  • 16
  • 76
  • 101
15
votes
2 answers

How to select an ListView item after long click?

I've got a silly little problem. I've registered a ListFragment both as OnItemClickListener and OnItemLongClickListener of its own ListView. When the onItemClick event is called, an intent for the detail view activity of that item is started, no…
11
votes
3 answers

Hiding contexual action bar while navigation drawer is open

The question is similar to this except for the fact that instead of using a View Pager (VP) I want to use a Navigation Drawer (ND). I have a list of elements that activates a Contextual Action Bar (CAB) when one/several items are selected through…
Cosmin
  • 201
  • 2
  • 8
11
votes
2 answers

OnItemLongClickListener is not working in a custom listview

I want context menu to appear after long clicking an item in a custom list view. I am using the ActionBarSherlock. Trying to debug using Toast notifications I have discovered that Long click event is not fired. How to resolve this issue…
Md. Arafat Al Mahmud
  • 3,124
  • 5
  • 35
  • 66
11
votes
1 answer

Contextual action bar weird behavior for menu item

I have some weird behavior in the contextual action bar. Firstly: One menu item is only shown every second time I click on the overflow button: Secondly / thirdly: Is there a way that the icons do not use so much space? When I change add property…
OschtärEi
  • 2,255
  • 3
  • 20
  • 41
10
votes
1 answer

Contextual Action Bar in Honeycomb

I'm looking to copy the action bar implementation from the gmail app in Honeycomb Unfortunately I can't post an image because I'm new here. Basically, when you select an email or more your action bar animates into a different action bar…
1
2 3
14 15