java – How to remove Navbar menu from WebView?-ThrowExceptions

Exception or error:

I try some another code but its not working for me.

Like

WebSettings webSettings = webView.getSettings();
        webSettings.setJavaScriptEnabled(true);
        webView.loadUrl("https://dbtagriculture.bihar.gov.in/HomePage.aspx");
        webView.getSettings().setBuiltInZoomControls(true);
        webView.setWebViewClient(new WebViewClient(){
            @Override
            public void onPageFinished(WebView view, String url) {
//                view.loadUrl("javascript:document.getElementsByClassName('navbar navbar-inverse navbar-fixed-top')[0].style.display='none'");
                view.loadUrl("javascript:document.getElementsByClassName('navbar navbar-default header-ontop')[0].style.display='none'");
                super.onPageFinished(view, url);
            }
        });

/ [1]: https://i.stack.imgur.com/Xzklx.png

How to solve:

Leave a Reply

Your email address will not be published. Required fields are marked *