0
我知道android根据语言环境选择适当的值文件夹。但我想从代码中自己选择它。如何以编程方式引用所需的值文件夹?
<com.example.typefacetest.CustomTextView
android:id="@+id/banglaTextView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
custom:banglaText="@string/hello_world"
android:text="@string/hello_world"
/>
在我values-bn
文件夹中,我有字符串文字命名hello_world
其用于属性custom:banglaText
。如果我没有设置语言环境,android将不会选择values-bn
文件夹。现在我想以编程方式从该文件夹中提取字符串。如何做?
我不想设置configuration.locale,因为这不被推荐。 http://stackoverflow.com/questions/2900023/change-language-programatically-in-android –