Android获取系统语言

Locale locale = getResources().getConfiguration().locale;

String language = locale.getLanguage();

String local = Locale.getDefault().toString();

String country =getResources().getConfiguration().locale.getCountry();

Log.e("zxy", "tjCountry: language:"+ language+",local:"+local+",country:"+country);

2019-05-20 14:35:13.231 28892-28892/? E/zxy: tjCountry: language:ko,local:ko_KR,country:KR

2019-05-20 14:36:35.851 2357-2357/? E/zxy: tjCountry: language:it,local:it_IT,country:IT

2019-05-20 14:37:20.689 3848-3848/? E/zxy: tjCountry: language:th,local:th_TH,country:TH

2019-05-20 14:37:42.060 4893-4893/? E/zxy: tjCountry: language:sk,local:sk_SK,country:SK

2019-05-20 14:38:30.373 6402-6402/? E/zxy: tjCountry: language:zh,local:zh_CN_#Hans,country:CN

2019-05-20 14:38:45.746 7024-7024/? E/zxy: tjCountry: language:ms,local:ms_SG,country:SG

2019-05-20 14:39:26.728 8264-8264/? E/zxy: tjCountry: language:zh,local:zh_CN_#Hans,country:CN

2019-05-20 14:39:47.535 9051-9051/? E/zxy: tjCountry: language:ms,local:ms_MY,country:MY

2019-05-20 14:41:21.035 10903-10903/? E/zxy: tjCountry: language:zh,local:zh_CN_#Hans,country:CN

2019-05-20 14:41:30.611 10903-10903/? E/zxy: tjCountry: language:fr,local:fr_CA,country:CA

2019-05-20 14:47:39.545 13311-13311/? E/zxy: tjCountry: language:zh,local:zh_CN_#Hans,country:CN

2019-05-20 14:47:59.557 14123-14123/? E/zxy: tjCountry: language:en,local:en_GB,country:GB

你可能感兴趣的:(Android获取系统语言)