如何获得应用程序支持的语言?
对于Android项目,我们可以通过查看项目目录(res / values)来了解应用程序支持的语言。有没有办法在运行时获取消息?
最佳答案
您可以使用下面的代码,但可以在上面的API 24中使用
val lang = applicationContext.resources.configuration.locales.toLanguageTags()
val langs = lang.split(",".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()
关于java - 如何以编程方式获取应用程序支持的语言,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/55721141/