如何从Android中不同区域设置字符串? [英] how to get string from different locales in Android?
本文介绍了如何从Android中不同区域设置字符串?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
所以,我希望得到一个字符串的几个区域设置的值,而不管该设备/应用程序的当前区域设置的。我应该怎么办呢?
So I want to get the value of a String in several locales regardless of the current locale setting of the device/app. How should I do that?
基本上,我需要的是一个函数的getString(INT ID,字符串区域)
,而不是的getString(INT ID)
Basically what I need is a function getString(int id, String locale)
rather than getString(int id)
我怎么能这样做呢?
感谢
推荐答案
您在找什么叫ResourceBundle类。这里的链接:
What you're looking for is called the ResourceBundle class. Here's the link:
这篇关于如何从Android中不同区域设置字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文