我有这个代码,它不起作用:
if (desctiption == "net :: ERR_INVALID_ARGUMENT" ")
相反,如果我写
if (desctiption! =" Net :: ERR_INVALID_ARGUMENT "")
我创建了Toast对象,文本等于
net: : ERR_INVALID_ARGUMENT
代码:
webView.setWebViewClient(new WebViewClient() {
@Override
public void onReceivedError(WebView view, int errorCode,
String description, String failingUrl) {
super.onReceivedError(view, errorCode, description, failingUrl);
Toast toast = Toast.makeText(getBaseContext(),description, Toast.LENGTH_LONG);
if (description == "net::ERR_INVALID_ARGUMENT"){
toast.show();}
}
});
}