當前位置: 首頁>>代碼示例>>Java>>正文


Java WebBackForwardList.getItemAtIndex方法代碼示例

本文整理匯總了Java中android.webkit.WebBackForwardList.getItemAtIndex方法的典型用法代碼示例。如果您正苦於以下問題:Java WebBackForwardList.getItemAtIndex方法的具體用法?Java WebBackForwardList.getItemAtIndex怎麽用?Java WebBackForwardList.getItemAtIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.webkit.WebBackForwardList的用法示例。


在下文中一共展示了WebBackForwardList.getItemAtIndex方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onPageFinished

import android.webkit.WebBackForwardList; //導入方法依賴的package包/類
public void onPageFinished(WebView view) {
    if (!mIsOnReceivedTitle && mWebChromeClient != null) {

        WebBackForwardList list = null;
        try {
            list = view.copyBackForwardList();
        } catch (NullPointerException e) {
            if (LogUtils.isDebug()) {
                e.printStackTrace();
            }
        }
        if (list != null
                && list.getSize() > 0
                && list.getCurrentIndex() >= 0
                && list.getItemAtIndex(list.getCurrentIndex()) != null) {
            String previousTitle = list.getItemAtIndex(list.getCurrentIndex()).getTitle();
            mWebChromeClient.onReceivedTitle(view, previousTitle);
        }
    }
}
 
開發者ID:Justson,項目名稱:AgentWeb,代碼行數:21,代碼來源:AgentWebView.java

示例2: printBackForwardList

import android.webkit.WebBackForwardList; //導入方法依賴的package包/類
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 );
    }
}
 
開發者ID:aabognah,項目名稱:LoRaWAN-Smart-Parking,代碼行數:11,代碼來源:CordovaWebView.java

示例3: startOfHistory

import android.webkit.WebBackForwardList; //導入方法依賴的package包/類
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;
}
 
開發者ID:aabognah,項目名稱:LoRaWAN-Smart-Parking,代碼行數:14,代碼來源:CordovaWebView.java

示例4: goBack

import android.webkit.WebBackForwardList; //導入方法依賴的package包/類
@Override
public void goBack() {
    WebBackForwardList list = mWebView.copyBackForwardList();
    int curIndex = list.getCurrentIndex();
    WebHistoryItem curItem = list.getCurrentItem();
    WebHistoryItem prevItem = list.getItemAtIndex(curIndex - 1);
    int steps = 0;
    if (prevItem != null) {
        steps--;
        if (prevItem.getUrl().equals(JoyWeb.getCookie())) {
            prevItem = list.getItemAtIndex(curIndex - 2);
            if (prevItem != null) {
                steps--;
                if (UriUtils.isEquals(prevItem.getUrl(), curItem.getUrl())) {
                    prevItem = list.getItemAtIndex(curIndex - 3);
                    if (prevItem != null) {
                        steps--;
                        goBackOrForward(steps);
                    } else {
                        mBaseView.finish();
                    }
                    return;
                }
                goBackOrForward(steps);
            } else {
                mBaseView.finish();
            }
            return;
        }
        if (goBackOrForward(steps)) {
            return;
        }
    }
    mBaseView.finish();
}
 
開發者ID:joy-inc,項目名稱:core-web,代碼行數:36,代碼來源:BaseWebViewPresenter.java

示例5: goForward

import android.webkit.WebBackForwardList; //導入方法依賴的package包/類
@Override
public void goForward() {
    WebBackForwardList list = mWebView.copyBackForwardList();
    int curIndex = list.getCurrentIndex();
    WebHistoryItem curItem = list.getCurrentItem();
    WebHistoryItem nextItem = list.getItemAtIndex(curIndex + 1);
    int steps = 0;
    if (nextItem != null) {
        steps++;
        if (nextItem.getUrl().equals(JoyWeb.getCookie())) {
            nextItem = list.getItemAtIndex(curIndex + 2);
            if (nextItem != null) {
                steps++;
                if (UriUtils.isEquals(nextItem.getUrl(), curItem.getUrl())) {
                    nextItem = list.getItemAtIndex(curIndex + 3);
                    if (nextItem != null) {
                        steps++;
                        goBackOrForward(steps);
                    } else {
                        mBaseView.showToast(R.string.toast_no_next_page);
                    }
                    return;
                }
                if (goBackOrForward(steps)) {
                    return;
                }
            }
        }
        if (goBackOrForward(steps)) {
            return;
        }
    }
    mBaseView.showToast(R.string.toast_no_next_page);
}
 
開發者ID:joy-inc,項目名稱:core-web,代碼行數:35,代碼來源:BaseWebViewPresenter.java

示例6: ingoreWebViewBackNavigation

import android.webkit.WebBackForwardList; //導入方法依賴的package包/類
private boolean ingoreWebViewBackNavigation(WebView vpaidWebView) {

        if (vpaidWebView != null) {
            WebBackForwardList mWebBackForwardList = vpaidWebView.copyBackForwardList();

            if (mWebBackForwardList == null) {
                return false;
            }


            WebHistoryItem historyItem = mWebBackForwardList.getItemAtIndex(mWebBackForwardList.getCurrentIndex() - 1);

            if (historyItem == null) {
                return false;
            }

            String historyUrl = historyItem.getUrl();


            if (historyUrl != null && historyUrl.equalsIgnoreCase(VpaidClient.EMPTY_URL)) {

                return true;
            }
        }

        return false;
    }
 
開發者ID:Tubitv,項目名稱:TubiPlayer,代碼行數:28,代碼來源:DoubleViewTubiPlayerActivity.java


注:本文中的android.webkit.WebBackForwardList.getItemAtIndex方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。