当前位置: 首页>>代码示例>>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;未经允许,请勿转载。