How can I get the WebView search bar to navigate as well as search?

56 Views Asked by At

My app creates a Web browser using WebViewClient like so:

    browser_page = findViewById(R.id.browser_page);
    browser_page.getSettings().setJavaScriptEnabled(true);
    browser_page.setWebViewClient(new WebViewClient() {
        @Override
        public void onPageStarted(WebView view, String url, Bitmap favicon) {
            // TODO Auto-generated method stub
            super.onPageStarted(view, url, favicon);
            spinner.setVisibility(View.VISIBLE);
            Toast.makeText(activity, getString(R.string.loading_comments), Toast.LENGTH_SHORT).show();
        }
    .
    .
    .

If I enter the URL https://app.opencomments.com/comment/OGqfjp1gKbFsl6bHz8Sk into the search bar, the WebView takes me here:

enter image description here

instead of here, which is where the Chrome search bar takes me:

enter image description here

How can I get the WebView to function as both a search bar and navigation bar, like Chrome does? I've already Googled this problem and tried what was suggested on SO, but no luck.

0

There are 0 best solutions below