Give a look at setCustomSelectionActionModeCallback(..)
Then in your custom ActionMode.Callback, can fetch the selected text with:
int start = myTextView.getSelectionStart();
int end = myTextView.getSelectionEnd();
Pregunta
How can I achieve this :
When I select text I want the bar to show not only "copy" ,"select all" and "confirm" but also a "share" icon like on a screenshot
Solución
Give a look at setCustomSelectionActionModeCallback(..)
Then in your custom ActionMode.Callback, can fetch the selected text with:
int start = myTextView.getSelectionStart();
int end = myTextView.getSelectionEnd();