Resources res = getResources();
Configuration conf = res.getConfiguration();
conf.locale = Locale.TRADITIONAL_CHINESE;
DisplayMetrics dm = res.getDisplayMetrics();
res.updateConfiguration(conf, dm);
這段程式碼還可以搭配 Preference 設定,讓使用者在程式中自己選擇想要的語系。
update: 要針對不同語系做處理時,可以直接判斷
if (conf.locale == Locale.TRADITIONAL_CHINESE)
0 意見:
Post a Comment