title: Listen to selection text change in webView android
body: <p>I am trying to notify the user when text selection changes in WebView Android . </p>
  
  <p>I tried to use<code>setOnTouchListener</code> and listen to </p>
  
  <pre><code>android.view.MotionEvent.ACTION_UP
  </code></pre>
  
  <p>and compare last selection text with new one after touch up  , using:</p>
  
  <pre><code>webview.loadUrl("javascript:js.callback(window.getSelection().toString())");
  </code></pre>
  
  <p>and </p>
  
  <pre><code>webSettings.setJavaScriptEnabled(true);
  myWebView.addJavascriptInterface(new WebAppInterface(), "Android");
  public class WebAppInterface {
          @JavascriptInterface
          public void callback(String value) {
              Log.d(getClass().getName(), value);
              selected = value;
              if (selected.length() &gt; 0) {
                  Snackbar.make(findViewById(android.R.id.content), selected, Snackbar.LENGTH_SHORT).show();
              }
          }
  }
  </code></pre>
  
  <p>But I have problem that when user drag/change selection cursor , <code>OnTouch</code> not fired </p>