我正在加载网址到webview:
WebView webview=(WebView)findViewById(R.id.webview);
webview.loadUrl(url);
Run Code Online (Sandbox Code Playgroud)
加载网址需要一些时间,在此期间显示空白屏幕.我想在加载网址时显示进度对话框:
ProgressDialog dialog = ProgressDialog.show(this, "HI","Loading......", true);
Run Code Online (Sandbox Code Playgroud)
但是,上面的代码是行不通的.如果有任何想法,请帮助.提前致谢.
我有一个简单的网络视图来通过网络显示网页。它可以很好地加载大多数页面,但每当我尝试加载时http://www.nytimes.com,它都会显示为空白。此时的logcat是:
09-11 11:26:18.428 10567-10630/com.project.test.webviewtest W/cr_media: Requires BLUETOOTH permission
09-11 11:26:18.454 10567-10567/com.project.test.webviewtest W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
09-11 11:26:18.470 10567-10567/com.project.test.webviewtest I/cr_Ime: ImeThread is not enabled.
09-11 11:26:18.486 10567-10650/com.project.test.webviewtest D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
09-11 11:26:18.512 10567-10657/com.project.test.webviewtest E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
09-11 11:26:18.530 10567-10650/com.project.test.webviewtest I/OpenGLRenderer: Initialized EGL, version 1.4
09-11 11:26:18.538 10567-10657/com.project.test.webviewtest W/VideoCapabilities: Unrecognized profile 2130706433 for video/avc
09-11 11:26:18.557 10567-10657/com.project.test.webviewtest I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
09-11 11:26:18.926 10567-10567/com.project.test.webviewtest W/cr_BindingManager: Cannot call determinedVisibility() - never saw a …Run Code Online (Sandbox Code Playgroud)