public void callwebtwo(){
loadweb = (WebView) findViewById(R.id.loadweb);
loadweb2 = (WebView) findViewById(R.id.loadweb2);
loadweb2.getSettings().setJavaScriptEnabled(true);
loadweb.getSettings().setJavaScriptEnabled(true);
loadweb2.loadUrl("http://www.google.co.in/");
loadweb.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.i("shouldOverrideUrlLoading", url.toString());
return super.shouldOverrideUrlLoading(view, url);
}
@Override
public void onPageFinished(WebView view, String url) {
Log.i("onPageFinished", url.toString());
super.onPageFinished(view, url);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
Log.i("onPageStarted", url.toString());
super.onPageStarted(view, url, favicon);
}
}
});
loadweb2.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
Log.i("shouldOverrideUrlLoading", url.toString());
return super.shouldOverrideUrlLoading(view, url);
}
@Override
public void onPageFinished(WebView view, String url) {
Log.i("onPageFinished", url.toString());
super.onPageFinished(view, url);
}
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
Log.i("onPageStarted", url.toString());
super.onPageStarted(view, url, favicon);
}
});
}
両方の Web のインスタンスは異なるため、別々に機能し、実行されます。