【发布时间】:2012-09-13 18:37:24
【问题描述】:
我正在尝试一个简单的检查。如果字符串名称语言环境具有“es”作为值。
public String locale =
Locale.getDefault().getLanguage().toLowerCase().toString();
// ...
Log.v(tag, "Idioma del sistema: «" + locale +"»");
if (locale != "es") {
showDialog(R.string.warningTitleDialog,
"We are sorry that this tool is only available in Spanish " +
"language. See Author menu item for more information. [" +
locale + "]");
locale = "en";
}
adb logcat 将“es”显示为字符串“locale”的内容,但条件内的代码正在执行。
【问题讨论】:
标签: android string compare logic operator-keyword