Android WebView 第一页在销毁后启动时未加载
我有一个 WebView,虽然它加载页面需要几秒钟的时间,但我想显示除白屏之外的其他内容,因此我在加载第一页之前加载静态数据
webview.loadDataWithBaseURL("/", wait_html, "text/html", "UTF-8", "");
现在,当我按下后退按钮时,我的活动被破坏,当我重新启动它时,我通常会收到如下警告:
webcore 第一次布局后无法获取 viewWidth
,并且我的静态内容未显示,但之后加载的页面显示没有问题。那么...关于如何让它显示我的静态内容有什么建议吗?
I have a WebView and while it loads the page which takes some seconds I want to show something other than a white screen, so I'm loading static data before loading the first page
webview.loadDataWithBaseURL("/", wait_html, "text/html", "UTF-8", "");
Now, when I press the back button my activity is destroyed and when I restart it, more often than not, I get a warning like:
webcore Can't get the viewWidth after the first layout
and my static content is not displayed but the page that is loaded after is displayed without problems. So... any suggestions on how to make it show my static content?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论