开发者

Getting string from other then default language

开发者 https://www.devze.com 2023-03-15 16:18 出处:网络
I am having a problem in accessing Locale string in android. The requirement is:- I have one string in english(values/string.xml) as well a开发者_如何学JAVAs in korean(values-ko/string.xml). Now i wa

I am having a problem in accessing Locale string in android.

The requirement is:-

I have one string in english(values/string.xml) as well a开发者_如何学JAVAs in korean(values-ko/string.xml). Now i want to show my string in both languages in a single activity.

I don't want to change phone Locale or call Locale.setDefault("ko")

I am trying to call following line but it is not working for me.

getString(R.string.mystring, Locale.KOREAN); //(My default language is English)

Please help


try

getResources().getString(R.string.mystring, Locale.KOREAN);

0

精彩评论

暂无评论...
验证码 换一张
取 消