블로그 이미지
Kanais
Researcher & Developer 퍼즐을 완성하려면 퍼즐 조각들을 하나 둘씩 맞춰나가야 한다. 인생의 퍼즐 조각들을 하나 둘씩 맞춰나가다 보면 인생이란 퍼즐도 완성되는 날이 오려나...?

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Notice

05-05 05:12

Recent Post

Recent Comment

Recent Trackback

Archive

2016. 5. 24. 10:28 Programming/Android


 원글 작성날짜 : 2012-07-05

 수정 날짜 : 2016-06-28



출처 : 안드로이드펍 - 원조안드로이드

        머라카노 - 안드로이드 현재 설정된 언어 가져오기


현재 설정된 언어 가져오기


Locale locale = getResources().getConfiguration().locale;

String displayCountry =  locale.getDisplayCountry();

String country =  locale.getCountry();

String language =  locale.getLanguage(); 


 Locale en = Locale.US;

Configuration config = new Configuration();
config.locale = en;
getResources().updateConfiguration(config, getResources().getDisplayMetrics());


위에 처럼 하시면 기존의 각 언어별 values 폴더의 strings.xml을 사용하시는 효과는 볼 수 있습니다.

posted by Kanais