我经常通过电话的区域设置为服务器URL的一部分。
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();
}
我不想回忆 getLocalStr()
每次我生成一个URL的时间。有没有得到通知系统区域设置更改时的方式?
I don't want to recall getLocalStr()
every time I generate a URL. Is there a way to get notified when system locale changes?
这是意图为这个广播:
http://developer.android.com/reference/android/content/Intent.html#ACTION_LOCALE_CHANGED