Search in sources :

Example 1 with WebHistoryItem

use of android.webkit.WebHistoryItem in project newsrob by marianokamp.

the class ShowArticleActivity method dumpHistory.

private void dumpHistory() {
    if (false) {
        WebBackForwardList history = webView.copyBackForwardList();
        for (int i = 0, lim = history.getSize(); i < lim; i++) {
            WebHistoryItem hi = history.getItemAtIndex(i);
            System.out.println("XXX" + i + "    url = " + hi.getUrl() + " originalUrl=" + hi.getOriginalUrl());
        }
        System.out.println("XXX current url=" + selectedEntry.getAlternateHRef());
    }
}
Also used : WebHistoryItem(android.webkit.WebHistoryItem) WebBackForwardList(android.webkit.WebBackForwardList)

Example 2 with WebHistoryItem

use of android.webkit.WebHistoryItem 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);
    }
}
Also used : WebHistoryItem(android.webkit.WebHistoryItem) WebBackForwardList(android.webkit.WebBackForwardList) SuppressLint(android.annotation.SuppressLint)

Example 3 with WebHistoryItem

use of android.webkit.WebHistoryItem 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();
    }
}
Also used : WebHistoryItem(android.webkit.WebHistoryItem) TabView(org.mozilla.focus.tabs.TabView) WebView(android.webkit.WebView) WebBackForwardList(android.webkit.WebBackForwardList)

Example 4 with WebHistoryItem

use of android.webkit.WebHistoryItem 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();
    }
}
Also used : WebHistoryItem(android.webkit.WebHistoryItem) TabView(org.mozilla.focus.tabs.TabView) WebView(android.webkit.WebView) WebBackForwardList(android.webkit.WebBackForwardList)

Example 5 with WebHistoryItem

use of android.webkit.WebHistoryItem in project phonegap-facebook-plugin by Wizcorp.

the class CordovaWebView method startOfHistory.

// Can Go Back is BROKEN!
public boolean startOfHistory() {
    WebBackForwardList currentList = this.copyBackForwardList();
    WebHistoryItem item = currentList.getItemAtIndex(0);
    if (item != null) {
        // Null-fence in case they haven't called loadUrl yet (CB-2458)
        String url = item.getUrl();
        String currentUrl = this.getUrl();
        LOG.d(TAG, "The current URL is: " + currentUrl);
        LOG.d(TAG, "The URL at item 0 is: " + url);
        return currentUrl.equals(url);
    }
    return false;
}
Also used : WebHistoryItem(android.webkit.WebHistoryItem) WebBackForwardList(android.webkit.WebBackForwardList)

Aggregations

WebHistoryItem (android.webkit.WebHistoryItem)8 WebBackForwardList (android.webkit.WebBackForwardList)7 SuppressLint (android.annotation.SuppressLint)3 WebView (android.webkit.WebView)3 TabView (org.mozilla.focus.tabs.TabView)2 ViewGroup (android.view.ViewGroup)1