Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Highlight a specific text in WebView android 4.0

I want to highlight a specific (searching) text on WebView. I use the code

 myWebView.findAll(txtSearch);

 try {
      for (Method m : WebView.class.getDeclaredMethods()) {
         if (m.getName().equals("setFindIsUp")) {
          m.setAccessible(true);
          m.invoke(myWebView, true);
          break;
        }
    }
     } catch (Exception ignored) {
       }

This works great on Android 2.2, but it doesn't work on Android 4.0 and above

like image 1000
AITAALI_ABDERRAHMANE Avatar asked May 02 '26 22:05

AITAALI_ABDERRAHMANE


1 Answers

Yes, you are right, highlight text on WebView works great on Android 2.2, but he appeared as not working on Android 4.0 and above

look at this link

here

like image 56
Coder_Me Avatar answered May 05 '26 13:05

Coder_Me



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!