关于多语言支持的问题,Locale如何控制选择哪一个values?
Resources res = getResources();Configuration conf = res.getConfiguration();conf.locale = Locale.JAPAN;DisplayMetrics dm = res.getDisplayMetrics();res.updateConfiguration(conf, dm);
<?xml version="1.0" encoding="utf-8"?><resources> <string name="app_name">Hello World, LcleActivity!</string> <string name="str1">すべての道はローマに通ず!</string> <string name="str2">ローマは一日にして成らず!</string> <string name="str3">知識は力なり</string></resources>
<TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="18sp" android:text="@string/str1" />