When my app starts up for the first time, I want to detect the user's current locale and set a SharedPreference accordingly. I'm grabbing the user's current locale from getResources(), which I've come to understand is set when the app starts for the first time:
// Set the locale
Locale locale = getResources().getConfiguration().locale;
if(locale != Locale.US)
{
Log.i("ActivityDownloader", "Locale: " + locale.toString() + ", (" + Locale.US.toString() + ")");
}
Unfortunately, I'm seeing that log entry in the console with the following text:
I/ActivityDownloader: Locale: en_US, (en_US)
Why don't the two Locale match? Should I be matching Locale.toString() instead?