Android - 屏幕锁定后,WebView为空白

时间:2013-10-10 13:30:52

标签: android webview

我遇到了WebView的问题。基本上我有一个WebView,并希望显示位于我的设备的资源文件夹中的html。

如果我使用WebView启动Activity,它将显示资产文件的内容,但如果我锁定屏幕(短按电源按钮)并返回应用程序,则不会显示WebView的内容。真正奇怪的部分是,一旦我点击Activity中的内容,WebView就会显示内容。

有没有人遇到类似Webview的问题?


代码:

在我的Activity的onResume方法中,我将数据加载到WebView

webView.loadUrl( webViewUrl );
<ScrollView 
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="5dp"
    android:layout_below="@id/nameWrapper"
    android:layout_above="@id/buttonWrapper">

    <WebView 
        android:id="@+id/description"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/transparent"
        android:textColor="@color/black"/>

</ScrollView>

0 个答案:

没有答案
相关问题