我在活动中使用网络视图。当我在手机上运行我的应用程序时,我可以看到很多(连续的)带有 Tag BaseLayerAndroid 的日志消息。
02-07 13:29:06.458: D/BaseLayerAndroid(27721): Creating BaseLayerAndroid = 0x1a328b8
02-07 13:29:06.505: D/BaseLayerAndroid(27721): Destroying BaseLayerAndroid = 0x1977130
02-07 13:29:06.560: D/BaseLayerAndroid(27721): Creating BaseLayerAndroid = 0x197fa88
02-07 13:29:06.599: D/BaseLayerAndroid(27721): Destroying BaseLayerAndroid = 0x1a328b8
02-07 13:29:06.653: D/BaseLayerAndroid(27721): Creating BaseLayerAndroid = 0x199fbd0
02-07 13:29:06.685: D/BaseLayerAndroid(27721): Destroying BaseLayerAndroid = 0x197fa88
02-07 13:29:06.755: D/BaseLayerAndroid(27721): Creating BaseLayerAndroid = 0x1ba8018
02-07 13:29:06.786: D/BaseLayerAndroid(27721): Destroying BaseLayerAndroid = 0x199fbd0
02-07 13:29:06.856: D/BaseLayerAndroid(27721): Creating BaseLayerAndroid = 0x19c48d0
02-07 13:29:06.903: D/BaseLayerAndroid(27721): Destroying BaseLayerAndroid = 0x1ba8018
02-07 13:29:06.966: D/BaseLayerAndroid(27721): Creating BaseLayerAndroid = 0x1a20a90
02-07 13:29:07.021: D/BaseLayerAndroid(27721): Destroying BaseLayerAndroid = 0x19c48d0
02-07 13:29:07.067: D/BaseLayerAndroid(27721): Creating BaseLayerAndroid = 0x198e480
02-07 13:29:07.099: D/BaseLayerAndroid(27721): Destroying BaseLayerAndroid = 0x1a20a90
02-07 13:29:07.169: D/BaseLayerAndroid(27721): Creating BaseLayerAndroid = 0x1977140
02-07 13:29:07.216: D/BaseLayerAndroid(27721): Destroying BaseLayerAndroid = 0x198e480
我的基本代码是:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.display);
progress = (ProgressBar) findViewById(R.id.progressBar1);
webview = (WebView) findViewById(R.id.webView1);
webSettings = webview.getSettings();
webSettings.setBuiltInZoomControls(true);
webSettings.setJavaScriptEnabled(true);
webview.setWebViewClient(new WebViewClient(){
@Override
public void onPageStarted(WebView view, String url, Bitmap favicon) {
// TODO Auto-generated method stub
super.onPageStarted(view, url, favicon);
progress.setActivated(true);
progress.setVisibility(ProgressBar.VISIBLE);
}
@Override
public void onPageFinished(WebView view, String url) {
// TODO Auto-generated method stub
super.onPageFinished(view, url);
progress.setActivated(false);
progress.setVisibility(ProgressBar.INVISIBLE);
}
});
new Thread(new Runnable() {
public void run() {
webview.loadUrl("some url");
}
}).start();
即使当我退出活动并显示 webview 时,我也会不断收到此日志消息。谁能帮我分析这些日志消息的全部内容以及为什么它们以如此快的速度出现。