安卓的WebView的方法GoBack的()显示一个空白页 [英] Android: WebView's method goBack() shows a blank page

查看:1312
本文介绍了安卓的WebView的方法GoBack的()显示一个空白页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Android应用程序加载在一个web视图的活动网页。我使用的手动检索网页和使用的WebView的 loadDataWithBaseURL 以显示在屏幕上。一切有细。

I have an android application that loads web pages in an activity with a WebView. I am using the retrieving the page manually and using WebView's loadDataWithBaseURL to display it on screen. Everything there is fine.

现在,我试图覆盖后退按钮preSS模拟回去了的WebView历史堆栈。我能够覆盖后退按钮preSS,我可以看到,有一个在web视图历史堆栈,我可以看到,历史上的网址是正确的,但是当我打电话的WebView的 GoBack的()方法,它会显示一个空白页。

Now, i am trying to override the Back button press to simulate going back in the WebView history stack. I am able to override the Back button press, i can see that there is a history stack in the WebView, i can see that the history url is correct, but when i call WebView's goBack() method, it displays a blank page.

任何人都遇到过这种前或者给我一些建议着手从这?

Anyone encountered this before or give me a couple of suggestions to proceed from this?

修改:如果我使用的WebView的使用loadURL 方式,后退按钮与一个覆盖按预期工作。但是,为什么....如果我需要手动处理这个问题,我如何下手历史记录页面搞乱?

Edit: If i use WebView's loadUrl method, the Back button with an override works as intended. But why.... If i need to handle this manually, how do i start messing with history pages?

推荐答案

我得到了同样的问题也。我发现这个问题就走了,如果我设置了呼叫loadDataWithBaseURL的historyUrl参数。

I got the same problem also. I found that the problem went away if I set the historyUrl parameter on the call to loadDataWithBaseURL.

这篇关于安卓的WebView的方法GoBack的()显示一个空白页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆