首页 > 代码库 > WebView返回时设置Title

WebView返回时设置Title

private TextView mWebTitle;
private com.tencent.smtt.sdk.WebView mX5Web;

.........
if (mX5Web.canGoBack()) {            mX5Web.goBack();            com.tencent.smtt.sdk.WebBackForwardList list = mX5Web.copyBackForwardList();            com.tencent.smtt.sdk.WebHistoryItem item = list.getCurrentItem();            if (item != null) {                mWebTitle.setText(item.getTitle());            }        }

  

WebView返回时设置Title