How to get locale with region?

后端 未结 3 1726
不思量自难忘°
不思量自难忘° 2021-02-15 06:30

I am trying to get the current device locale with the region like \"en_us\",\"en_gb\".

I am calling Locale.getDefault().getLanguage() and it returns only th

3条回答
  •  遇见更好的自我
    2021-02-15 07:31

    Use

    Locale.getDisplayName();
    

    This is shorthand for

    Locale.getDisplayName(Locale.getDefault());
    

    The documentation is in here:http://developer.android.com/reference/java/util/Locale.html

提交回复
热议问题