这段代码中有什么问题,它说强制关闭?使用进度对话框时出错
ourBrow = (WebView) findViewById(R.id.wvBrowser);
ourBrow.setBackgroundColor(Color.parseColor("#000000"));
ourBrow.getSettings().setJavaScriptEnabled(true);
ourBrow.setWebViewClient(new WebViewClient() {
ProgressDialog dialog;
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
dialog = ProgressDialog.show(Moile_gole.this, "",
"Loading. Please wait...", true);
ourBrow.loadUrl(url);
return true;
}
@Override
public void onPageFinished(WebView view, String url) {
dialog.dismiss();
// HIDE PROGRESS DIALOG LOADING IT HAS FINISHED
}
});
ourBrow.loadUrl("http://www.google.com");
日志猫:
10-03 20:43:59.440: D/AndroidRuntime(304): Shutting down VM 10-03 20:43:59.440: W/dalvikvm(304):
threadid=1: thread exiting with uncaught exception (group=0x4001d800) 10-03 20:43:59.461: E/AndroidRuntime(304): FATAL EXCEPTION: main
10-03 20:43:59.461: E/AndroidRuntime(304): java.lang.NullPointerException
10-03 20:43:59.461: E/AndroidRuntime(304): at com.mobile.specification.Moile_Specification$2.onProgressChanged(Moile_Specification.java:68)
10-03 20:43:59.461: E/AndroidRuntime(304): at android.webkit.CallbackProxy.handleMessage(CallbackProxy.java:358)
10-03 20:43:59.461: E/AndroidRuntime(304): at android.os.Handler.dispatchMessage(Handler.java:99)
10-03 20:43:59.461: E/AndroidRuntime(304): at android.os.Looper.loop(Looper.java:123)
10-03 20:43:59.461: E/AndroidRuntime(304): at android.app.ActivityThread.main(ActivityThread.java:4627)
10-03 20:43:59.461: E/AndroidRuntime(304): at java.lang.reflect.Method.invokeNative(Native Method)
10-03 20:43:59.461: E/AndroidRuntime(304): at java.lang.reflect.Method.invoke(Method.java:521)
10-03 20:43:59.461: E/AndroidRuntime(304): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
10-03 20:43:59.461: E/AndroidRuntime(304): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
10-03 20:43:59.461: E/AndroidRuntime(304): at dalvik.system.NativeStart.main(Native Method)