I'm trying a simple check. If a string name locale has "es" as value.
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
shows "es" as content of string "locale" but code inside the condition is being executed.
It seem that problem is not of android or of logic this is in JAVA. Try this and tell us what is happening
if(!locale.equals("en"))
{
//Your Code
}