问题
I notice that when highlighting text in a WebView a share button appears along with the standard copy and select all buttons:
but when highlighting text in a TextView or EditText, there is no such button.
Is there any way to add such a button via XML or can it be done programmatically?
回答1:
You can achieve that by setting a custom selection action mode using
TextView.setCustomSelectionActionModeCallback(ActionMode.Callback)
and so the EditText
Here's a similar question with that was answered with an example
Also visit TextView.html#setCustomSelectionActionModeCallback
来源:https://stackoverflow.com/questions/22572711/how-to-add-a-share-button-to-the-text-selection-bar-for-an-edittext