本文整理匯總了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);
}
}
}
示例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 );
}
}
示例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);
}
}
示例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);
}
}