WebView如何在页面内返回时重设title

webView.setWebViewClient(new WebViewClient(){


@Override

public void onPageStarted(WebView view, String url, Bitmap favicon) {

if(url.contains("detail=detail")){

title_btn_right.setVisibility(View.VISIBLE);

}else{

title_btn_right.setVisibility(View.INVISIBLE);

}

//webView.setOnReceivedTitle(new MyOnReceivedTitle());

//webView.get

super.onPageStarted(view, url, favicon);

}


@Override

public void onPageFinished(WebView view, String url) {

String title=view.getTitle();

if(title==null){

title="";

}

WebviewActivity.this.setTitle(title);

super.onPageFinished(view, url);

}

});


你可能感兴趣的:(WebView如何在页面内返回时重设title)