use of android.webkit.WebBackForwardList in project phonegap-facebook-plugin by Wizcorp.
the class CordovaWebView method printBackForwardList.
public void printBackForwardList() {
WebBackForwardList currentList = this.copyBackForwardList();
int currentSize = currentList.getSize();
for (int i = 0; i < currentSize; ++i) {
WebHistoryItem item = currentList.getItemAtIndex(i);
String url = item.getUrl();
LOG.d(TAG, "The URL at index: " + Integer.toString(i) + " is " + url);
}
}
use of android.webkit.WebBackForwardList in project phonegap-facebook-plugin by Wizcorp.
the class CordovaWebView method restoreState.
public WebBackForwardList restoreState(Bundle savedInstanceState) {
WebBackForwardList myList = super.restoreState(savedInstanceState);
Log.d(TAG, "WebView restoration crew now restoring!");
// Initialize the plugin manager once more
this.pluginManager.init();
return myList;
}
use of android.webkit.WebBackForwardList in project Rocket by mozilla-tw.
the class BrowserFragment method goBack.
public void goBack() {
final TabView current = tabsSession.getFocusTab().getTabView();
if (current != null) {
WebBackForwardList webBackForwardList = ((WebView) current).copyBackForwardList();
WebHistoryItem item = webBackForwardList.getItemAtIndex(webBackForwardList.getCurrentIndex() - 1);
updateURL(item.getUrl());
current.goBack();
}
}
use of android.webkit.WebBackForwardList in project Rocket by mozilla-tw.
the class BrowserFragment method goForward.
public void goForward() {
final TabView current = tabsSession.getFocusTab().getTabView();
if (current != null) {
WebBackForwardList webBackForwardList = ((WebView) current).copyBackForwardList();
WebHistoryItem item = webBackForwardList.getItemAtIndex(webBackForwardList.getCurrentIndex() + 1);
updateURL(item.getUrl());
current.goForward();
}
}
use of android.webkit.WebBackForwardList in project focus-android by mozilla-mobile.
the class SystemWebView method restoreWebViewState.
@Override
public void restoreWebViewState(Session session) {
final Bundle stateData = session.getWebViewState();
final WebBackForwardList backForwardList = stateData != null ? super.restoreState(stateData) : null;
final String desiredURL = session.getUrl().getValue();
client.restoreState(stateData);
client.notifyCurrentURL(desiredURL);
if (backForwardList != null && backForwardList.getCurrentItem().getUrl().equals(desiredURL)) {
// restoreState doesn't actually load the current page, it just restores navigation history,
// so we also need to explicitly reload in this case:
reload();
} else {
loadUrl(desiredURL);
}
}
Aggregations