Android Webview:有没有办法知道以前的url是什么?

有没有办法访问历史logging,以便我知道当用户点击后退button(调用WebView.goBack())时用户访问的URL?

Solutions Collecting From Web of "Android Webview:有没有办法知道以前的url是什么?"

这可能是你正在寻找的方法: WebView.copyBackForwardList

 String historyUrl=""; myWebView = (WebView) findViewById(R.id.webViewContent); WebBackForwardList mWebBackForwardList = myWebView.copyBackForwardList(); if (mWebBackForwardList.getCurrentIndex() > 0) historyUrl = mWebBackForwardList.getItemAtIndex(mWebBackForwardList.getCurrentIndex()-1).getUrl(); // Previous url is in historyUrl