Cómo obtener el texto seleccionado en Android webview
Necesito obtener el texto seleccionado de la vista web y tengo que resaltar el texto permanentemente. Intenté seleccionar el texto y mientras intento obtener el texto usando el portapapeles, me muestra una excepción de puntero nulo en "clipboard.getText ()". He intentado el código como
ClipboardManager mClipboard =
(ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
KeyEvent shiftPressEvent = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN,
KeyEvent.KEYCODE_SHIFT_LEFT, 0, 0);
shiftPressEvent.dispatch(webview);
if(mClipboard!=null)
{
String text = mClipboard.getText().toString();
Toast.makeText(this, "select_text_now "+text, Toast.LENGTH_LONG).show();
}
Necesito obtener el texto seleccionado para resaltar más ... por favor, ayúdenme ...