android system 언어설정 값을 읽어오는 예제.
private byte verifyLanguageCode() {
byte retVal = 0;
Locale locale = mContext.getResources().getConfiguration().locale;
String language = locale.getLanguage();
String country = locale.getCountry();
String displayCountry = locale.getDisplayCountry();
Log.d(TAG,"[language:"+language+"] [country:"+country+"] [displayCountry:"+displayCountry+"]");
if ( language.toUpperCase().indexOf("ZH") != -1 ) {
retVal = 0;
} else if ( language.toUpperCase().indexOf("KO") != -1 ) {
retVal = 1;
} else {
retVal = 2;
}
return retVal;
}
댓글 없음:
댓글 쓰기