android WebView goBackOrForward()与goBack()的比较
我有一个WebView,我在点击后退按钮时使用WebView.goBack(),我在另一个地方使用WebView.goBackOrForward(x) 我的问题是,为什么WebView.goBackOrForward(x)会再次从internet加载已访问的网页,但WebView.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)
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.