WebView loadUrl()显示白屏

时间:2014-02-08 21:34:01

标签: android webview

我正在尝试创建一个简单的RSS源查看器,我有一个列表视图,一切正常,直到我点击列表项(故事)。我希望它打开一个webview,它开始使用以下代码。捆绑包中的URL是我尝试过的,但是当它无法正常工作时,我只尝试了普通的Google,但仍然是相同的。

屏幕变白,然后LogCat说:

02-08 14:39:44.180: D/dalvikvm(847): Not late-enabling CheckJNI (already on)
02-08 14:39:55.020: D/(847): HostConnection::get() New Host Connection established 0xb8535750, tid 847
02-08 14:39:55.690: W/EGL_emulation(847): eglSurfaceAttrib not implemented
02-08 14:39:55.750: D/OpenGLRenderer(847): Enabling debug mode 0
02-08 14:39:55.850: I/Choreographer(847): Skipped 110 frames!  The application may be doing too much work on its main thread.
02-08 14:40:00.970: D/dalvikvm(847): GC_FOR_ALLOC freed 68K, 5% free 3144K/3276K, paused 79ms, total 106ms
02-08 14:40:02.810: D/debug(847): The response is: 200
02-08 14:40:04.180: D/dalvikvm(847): GC_FOR_ALLOC freed 351K, 12% free 3294K/3716K, paused 66ms, total 70ms
02-08 14:40:05.160: D/dalvikvm(847): GC_FOR_ALLOC freed 453K, 14% free 3352K/3872K, paused 60ms, total 60ms
02-08 14:40:05.330: D/tst(847): 25
02-08 14:40:28.940: V/WebViewChromium(847): Binding Chromium to the background looper Looper (main, tid 1) {b3d8ed58}
02-08 14:40:29.010: I/chromium(847): [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
02-08 14:40:29.140: I/BrowserProcessMain(847): Initializing chromium process, renderers=0
02-08 14:40:30.190: W/chromium(847): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
02-08 14:40:31.630: D/URL(847): http://feeds.wired.com/c/35185/f/661370/s/36dbf423/sc/21/l/0L0Swired0N0Cgamelife0C20A140C0A    20Ceve0Eonline0Ebattle0Eof0Eb0Er0C/story01.htm
02-08 14:40:33.170: W/EGL_emulation(847): eglSurfaceAttrib not implemented
02-08 14:40:33.500: W/AwContents(847): nativeOnDraw failed; clearing to background color.
02-08 14:40:34.210: W/AwContents(847): nativeOnDraw failed; clearing to background color.
02-08 14:40:34.530: W/AwContents(847): nativeOnDraw failed; clearing to background color.
02-08 14:40:34.610: W/AwContents(847): nativeOnDraw failed; clearing to background color.
02-08 14:40:34.740: W/AwContents(847): nativeOnDraw failed; clearing to background color.
02-08 14:40:34.800: W/AwContents(847): nativeOnDraw failed; clearing to background color.
02-08 14:40:34.830: W/AwContents(847): nativeOnDraw failed; clearing to background color.
02-08 14:40:37.610: I/chromium(847): [INFO:simple_index_file.cc(397)] Simple Cache Index is being restored from disk.
02-08 14:40:38.180: E/eglCodecCommon(847): glUtilsParamSize: unknow param 0x00000b44
02-08 14:40:38.410: E/eglCodecCommon(847): glUtilsParamSize: unknow param 0x00000bd0
02-08 14:40:38.780: I/chromium(847): [INFO:async_pixel_transfer_manager_android.cc(56)]
Async pixel transfers not supported
02-08 14:40:39.140: E/chromium(847): [ERROR:gles2_cmd_decoder.cc(3389)]     GLES2DecoderImpl::ResizeOffscreenFrameBuffer failed to allocate storage for offscreen target depth buffer.
02-08 14:40:39.140: E/chromium(847): [ERROR:gles2_cmd_decoder.cc(2433)] Could not allocate offscreen buffer storage.
02-08 14:40:39.180: E/chromium(847): [ERROR:in_process_command_buffer.cc(465)] Could not initialize decoder.
02-08 14:40:39.190: A/libc(847): Fatal signal 11 (SIGSEGV) at 0x00000048 (code=1), thread 847 (obit.throbitapp)
02-08 14:40:45.930: D/(957): HostConnection::get() New Host Connection established 0xb8521c68, tid 957
02-08 14:40:46.050: W/EGL_emulation(957): eglSurfaceAttrib not implemented
02-08 14:40:46.080: D/OpenGLRenderer(957): Enabling debug mode 0
02-08 14:40:46.310: D/dalvikvm(957): GC_FOR_ALLOC freed 75K, 5% free 3136K/3276K, paused 73ms, total 76ms
02-08 14:40:48.310: D/debug(957): The response is: 200
02-08 14:40:48.970: D/dalvikvm(957): GC_FOR_ALLOC freed 353K, 12% free 3290K/3712K, paused 44ms, total 44ms
02-08 14:40:49.460: D/dalvikvm(957): GC_FOR_ALLOC freed 440K, 14% free 3355K/3864K, paused 43ms, total 43ms
02-08 14:40:49.600: D/tst(957): 25

然后它只是重新启动应用程序,我不知道该怎么做 WebView类

public class StoryWebView extends Activity{

private WebView webView;

protected void onCreate(Bundle savedInstanceState){
    super.onCreate(savedInstanceState);
    this.setContentView(R.layout.webview);

    Bundle bundle = this.getIntent().getExtras();
    String storyURL = bundle.getString("url");

    webView = (WebView) this.findViewById(R.id.webview);

    Log.d("URL", storyURL);
    webView.loadUrl("http://google.com");
}

}

WebView XML

<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>

我想要它做的就是在webview中打开网页,简单明了。 非常感谢任何帮助。

0 个答案:

没有答案