Reputation: 864
I am using webview in my android app. I am using ActionBar to show the title. So I want to remove title of HTML page shown in webview. So how can I do that? Thanks.
Upvotes: 0
Views: 557
Reputation: 864
Actually, my HTML page having tag as:
<div class="titlebar">Terms and Conditions</div>
So, following code has solved my problem using getElementsByClassName
:
browser.loadUrl("javascript:(function() { " +
"document.getElementsByClassName('titlebar')[0].style.display=\"none\"; " +
"})()");
Upvotes: 1
Reputation: 2514
You can do something like this.
web.setWebViewClient(new WebViewClient() {
@Override
public void onPageFinished(WebView view, String url){
web.loadUrl("javascript:document.getElementById('pagelet_bluebar')[0].style.display=\"none\";");
}
})
Or go for Jsoup
Upvotes: 2