这很奇怪。我有这个C#代码:
WebViewClient webViewClient = new WebViewClient() {
@TargetApi(VERSION_CODES.LOLLIPOP)
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) {
WebResourceResponse response = null;
if ("GET".equals(request.getMethod())) {
try {
response = getWebResponse(view.getContext().getApplicationContext(), request.getUrl().toString());
} catch (Exception e) {
Log.e(TAG, "Error while overriding getting web response", e);
}
}
return response;
}
@SuppressWarnings("deprecation")
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
WebResourceResponse response = null;
try {
response = getWebResponse(view.getContext().getApplicationContext(), url);
} catch (Exception e) {
Log.e(TAG, "Error while overriding getting web response", e);
}
return response;
}
WebResourceResponse getWebResponse(Context context, String url) {
// YOUR IMPLEMENTATION that will save resource located at passed url
}
}
webView.setWebViewClient(webViewClient);
当我使用Xamarin调试器检查它时,它告诉我bool value = (((Literal)expr.left).value == ((Literal)expr.right).value);
是value
,但false
是(((Literal)expr.left).value == ((Literal)expr.right).value)
。这是为什么?我很困惑......
答案 0 :(得分:4)
找到它。 >(matches go-to-plan-manager)
Matches for Pattern 1
f-4843
Activations
None
是((Literal)expr.left).value
,这意味着除非右边和左边的相同的布尔,否则它总是会返回false。
将它们都投射到bool会比较它们的值。
object