I'm regularly passing phone's locale as part of URL to the server.
private static String getLocaleStr() {
Locale locale = Locale.getDefault();
return locale.getLanguage() + locale.getCountry();
}
I don't want to recall getLocalStr()
every time I generate a URL. Is there a way to get notified when system locale changes?
An Intent is broadcast for this:
http://developer.android.com/reference/android/content/Intent.html#ACTION_LOCALE_CHANGED
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With