Can I access to resources from different locale android?

前端 未结 4 1579
执念已碎
执念已碎 2020-12-01 19:26

I have two locale in my application. Can I access to resources, for example string array from different locale without to change current locale ? I mean with coding I don\'t

4条回答
  •  南方客
    南方客 (楼主)
    2020-12-01 19:34

    Yes, you can. You have to create a new Resources object specifying the intending Configuration.

    Reference: http://developer.android.com/reference/android/content/res/Resources.html#Resources%28android.content.res.AssetManager,%20android.util.DisplayMetrics,%20android.content.res.Configuration%29

提交回复
热议问题