是否可以删除网页视图中的横幅?在我的网页视图中,我显示了一个论坛,并且有一个令人讨厌的横幅我想删除.. 有可能吗?有没有像 adBlock 之类的方法?我的代码:
public class MainActivity extends Activity
{
protected WebView webview;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
webview = (WebView) findViewById(R.id.webview);
WebSettings websettings = webview.getSettings();
websettings.setJavaScriptEnabled(true);
webview.setWebViewClient(new WebViewClient());
if (savedInstanceState == null)
{
webview.loadUrl("http://www.proboards.com/");
}
}
@Override
protected void onSavedInstanceState(Bundle outState) {
//super.onSavedInstanceState(outState);
webview.saveState(outState);
}
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
switch (keyCode) {
case KeyEvent.KEYCODE_BACK:
if(webview.canGoBack() == true)
webview.goBack();
else finish();
break;
default:
break;
}
return super.onKeyDown(keyCode, event);
}
}
谢谢。