当前位置: 首页>>代码示例>>Java>>正文


Java WebBackForwardList.getSize方法代码示例

本文整理汇总了Java中android.webkit.WebBackForwardList.getSize方法的典型用法代码示例。如果您正苦于以下问题:Java WebBackForwardList.getSize方法的具体用法?Java WebBackForwardList.getSize怎么用?Java WebBackForwardList.getSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.webkit.WebBackForwardList的用法示例。


在下文中一共展示了WebBackForwardList.getSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: navigateInHistoryIfPossible

import android.webkit.WebBackForwardList; //导入方法依赖的package包/类
public void navigateInHistoryIfPossible(String newUrl){
	if(webview!=null){
		WebBackForwardList history = webview.copyBackForwardList();
		for(int i=0;i<history.getSize();i++){
			if(newUrl.equals(history.getItemAtIndex(i).getOriginalUrl()) || newUrl.equals(history.getItemAtIndex(i).getUrl())){
				Log.d("WebView", "Found "+newUrl + " at "+i+", steps: "+(i-history.getCurrentIndex()));
				webview.goBackOrForward(i-history.getCurrentIndex());
				return;
			}
			
		}
		webview.loadUrl(newUrl);
	}
}
 
开发者ID:rockgecko-development,项目名称:connectedteam-android,代码行数:15,代码来源:WebFragment.java

示例4: printBackForwardList

import android.webkit.WebBackForwardList; //导入方法依赖的package包/类
public void printBackForwardList()
{
  WebBackForwardList localWebBackForwardList = copyBackForwardList();
  int i = localWebBackForwardList.getSize();
  for (int j = 0; j < i; j++)
  {
    String str = localWebBackForwardList.getItemAtIndex(j).getUrl();
    LOG.d("CordovaWebView", "The URL at index: " + Integer.toString(j) + "is " + str);
  }
}
 
开发者ID:zhangjianying,项目名称:12306-android-Decompile,代码行数:11,代码来源:CordovaWebView.java


注:本文中的android.webkit.WebBackForwardList.getSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。