setCustomSelectionActionModeCallback

Deprecated

Call setCustomSelectionActionModeCallback directly.

Sets a selection action mode callback on a TextView. Also this method can be used to fix a bug in framework SDK 26/27. On these affected devices, the bug causes the menu containing the options for handling ACTION_PROCESS_TEXT after text selection to miss a number of items. This method can be used to fix this wrong behaviour for a text view, by passing any custom callback implementation. If no custom callback is desired, a no-op implementation should be provided. Note that, by default, the bug will only be fixed when the default floating toolbar menu implementation is used. If a custom implementation of Menu is provided, this should provide the method Menu#removeItemAt(int) which removes a menu item by its position, as given by Menu#getItem(int). Also, the following post condition should hold: a call to removeItemAt(i), should not modify the results of getItem(j) for any j Menu interface. However, it is required, and going to be called by reflection, in order to display the correct process text items in the menu.

Parameters

textView

The TextView to set the action selection mode callback on.

callback

The action selection mode callback to set on textView.