X
X
xaiponews2020-09-04 23:42:44
Android
xaiponews, 2020-09-04 23:42:44

How to display part of a web page?

android studio how to display part of a webpage in a webview

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ihor, 2020-09-04
@xaiponews

final WebView webview = (WebView)findViewById(R.id.browser);
webview.getSettings().setJavaScriptEnabled(true);
webview.setWebViewClient(new WebViewClient() {
 @Override
public void onPageFinished(WebView view, String url)
{
    webview.loadUrl("javascript:(function() { " +
            "document.getElementsByTagName('header')[0].style.display="none"; " +
            "})()");
}
});
webview.loadUrl("http://code.google.com/android");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question