android webview displaying blank page

后端 未结 14 833
借酒劲吻你
借酒劲吻你 2020-12-14 06:33

I have an android application that I am developing using the emulator running on android 2.3.3 with an embedded WebView in a framelayout nested in a linearlayout (vertical).

14条回答
  •  遥遥无期
    2020-12-14 06:59

    It might be a bit too late, but I wanted to share my experience with you, because I had the same problem and spent a lot of time on it.

    Put your WebView in RelativeLayout and not in FrameLayout.

    What I have tested: My WebView's onPageFinished() was called every time, but on the screen I got blank page.

    From chrome://inspect WebView debugger I was able to "ping" my WebView by pressing inspect button, and after that WebView was refreshing immediately.

    My thoughts - WebView isn't rendered correctly in FrameLayout, and RelativeLayout fixes the issue (even invalidate() and requestLayout() calls didn't help).

提交回复
热议问题