Hope this helps you ...
public void selectAndCopyText() { try { Method m = WebView.class.getMethod("emulateShiftHeld", Boolean.TYPE); m.invoke(BookView.mWebView, false); } catch (Exception e) { e.printStackTrace();
override touch events
private void emulateShiftHeld(WebView view) { try { KeyEvent shiftPressEvent = new KeyEvent(0, 0, KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_SHIFT_LEFT, 0, 0); shiftPressEvent.dispatch(view); Toast.makeText(this, "select_text_now", Toast.LENGTH_SHORT).show(); } catch (Exception e) { Log.e("dd", "Exception in emulateShiftHeld()", e); } }
source share