3

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

Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134
AITAALI_ABDERRAHMANE
  • 2,499
  • 1
  • 26
  • 31

2 Answers2

1

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

Community
  • 1
  • 1
Coder_Me
  • 26
  • 2
1

i am also trying this highlight of text ,it is working perfectly on android version 2.2 but if i am trying the same thing in another version than the highlight text is not shown and one more thing that findasync() only works for api 16 .May be using java script can help i am working on that if it works i'll tell to you.

thanks