【发布时间】:2015-07-22 08:02:30
【问题描述】:
根据 debuggable 标志启用 WebView 调试,Google recommends the following code:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
if (0 != (getApplicationInfo().flags &= ApplicationInfo.FLAG_DEBUGGABLE)) {
WebView.setWebContentsDebuggingEnabled(true);
}
}
这不会有副作用吗,因为&= 运算符重新分配了flag 字段?我假设在此调用之后应用程序标志减少到FLAG_DEBUGGABLE。为什么要在此处使用 &= 运算符而不是 &?
【问题讨论】:
标签: android google-chrome android-webview