【问题标题】:Get the current language of the application not the device Android [duplicate]获取应用程序的当前语言而不是设备 Android [重复]
【发布时间】:2016-12-02 22:47:59
【问题描述】:

所以我正在使用一个按钮将语言从英语切换到法语!

我的问题是我需要知道我当前应用程序的语言,而不是我设备的语言。

我正在使用这行代码来了解当前的语言

Locale.getDefault().getLanguage()

但显然他正在返回我的设备语言。

任何帮助将不胜感激。

【问题讨论】:

    标签: android android-configchanges


    【解决方案1】:

    试试这个:

    getResources().getConfiguration().locale
    

    https://stackoverflow.com/a/12530405/6371926

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-15
      • 1970-01-01
      • 2012-01-31
      • 1970-01-01
      • 2012-04-20
      • 2011-10-13
      相关资源
      最近更新 更多