2
votes

When selecting text in an android text view, a contextual action bar comes up with options to copy, cut, select all, share, etc. Is there a way to capture the onClicks of these options and override them?

1
Not exactly. You can create your own ActionView, but you can't hijack clicks of others.Geobits
What about removing options in the menu, is that possible?thisiscrazy4
did you find an answer_Rahul
@noone Don't think I ever did.thisiscrazy4

1 Answers

0
votes

Try creating your own custom ActionMode.Callback for the text view. In the ActionMode.Callback you can create your own menu in which you can remove/change the options. You can also control the behavior with a

@Override
    public boolean onActionItemClicked(ActionMode mode, MenuItem item) {}

method override. see http://developer.android.com/guide/topics/ui/menus.html#CAB and Contextual Action Bar text selection for more information. Hope this helps!