當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。