得到的WebView历史,从WebBackForwardList [英] getting WebView history from WebBackForwardList
问题描述
我如何获得的WebView的使用 WebBackForwardList 类的历史?我看着文档页面但我无法理解,就是 WebBackForwardList 访问的WebView历史的正确方法?我打算解析历史到ListView,我找不到如何访问的WebView的历史上的例子,什么是正确的方法来获取历史?
How do i get the history of a WebView using the WebBackForwardList class? I looked at the documentation page but i could not understand it, is WebBackForwardList the proper way to access the history of WebView? I intend to parse the history to a ListView, I cannot find any examples of how to access the history of WebView, What is the proper method to get the history?
推荐答案
在网页视图情况下,只需使用copyBackForwardList(),例如:
On your webView instance, just use copyBackForwardList(), for example
WebBackForwardList wbfl = webView.copyBackForwardList();
WebBackForwardList wbfl = webView.copyBackForwardList();
然后设置一个for循环扫描清单,拉条目(例如,标题,URL),并将它们发送到您的ListView(或其他)。
Then setup a for-loop to scan the list, pull entries (e.g., title, URL), and send them to your ListView (or whatever).
这篇关于得到的WebView历史,从WebBackForwardList的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!