Android preload a url into WebView while splashscreen is showing

前端 未结 2 731
故里飘歌
故里飘歌 2021-02-06 15:41

I have an app with a splash-screen which after a few seconds opens up the main activity that has a WebView. The problem is that, only then, does the main activity start to load

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-06 16:11

    make a layout with a spash screen ABOVE your webview and setVisibility to View.GONE after X seconds. if you load the webview on onCreate it will be loaded behind the splash, and when the splash screen disapears you have a already loaded Webview :)

提交回复
热议问题