Resources res = getResources();
Configuration conf = res.getConfiguration();
conf.locale = Locale.JAPAN;
DisplayMetrics dm = res.getDisplayMetrics();
res.updateConfiguration(conf, dm);
/res/values-ja/strings.xml<?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" />
程序运行后,TextView的android:text并没有指向res/values-ja/strings.xml,还是指向默认的res/values/strings.xml,请问这段程序该怎么改?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货