Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android WebView goBackOrForward()与goBack()的比较_Android_Webview - Fatal编程技术网

android WebView goBackOrForward()与goBack()的比较

android WebView goBackOrForward()与goBack()的比较,android,webview,Android,Webview,我有一个WebView,我在点击后退按钮时使用WebView.goBack(),我在另一个地方使用WebView.goBackOrForward(x) 我的问题是,为什么WebView.goBackOrForward(x)会再次从internet加载已访问的网页,但WebView.goBack()不会再次加载已访问的网页并快速显示以前的网页?如中所示: 反而 goBackOrForward Added in API level 1 void goBackOrForward (int steps)

我有一个WebView,我在点击后退按钮时使用WebView.goBack(),我在另一个地方使用WebView.goBackOrForward(x)

我的问题是,为什么WebView.goBackOrForward(x)会再次从internet加载已访问的网页,但WebView.goBack()不会再次加载已访问的网页并快速显示以前的网页?

如中所示:

反而

goBackOrForward
Added in API level 1
void goBackOrForward (int steps)
Goes to the history item that is the number of steps away from the current item. Steps is negative if backward and positive if forward.
我假设知道WebView将加载哪个页面会使它更快,因为
goBack
总是加载上一个页面
goBackOrForward
需要在加载页面之前计算需要加载的页面。我不确定,你应该检查代码

goBackOrForward
Added in API level 1
void goBackOrForward (int steps)
Goes to the history item that is the number of steps away from the current item. Steps is negative if backward and positive if forward.