Monday, 12 April 2021

Android Webview - how to navigate to the NEXT occurence of the searched text

Searching for a text in a WebView is easy. Navigating to the first occurence of the searched text goes like this:

 webView.findAllAsync(whatToFind);
    webView.setFindListener((i, i1, b) -> {
        if (b) {
            webView.findNext(true);
        }
    });

How can I navigate to the NEXT occurence of the searched text?

I tried this but this will not navigate to the next occurence.

webView.findNext(true);

I loaded the webview in this way:

webView.loadDataWithBaseURL("", formatHtmlContent(content), "text/html", "UTF-8", "");


from Android Webview - how to navigate to the NEXT occurence of the searched text

No comments:

Post a Comment