Android get device locale

后端 未结 7 2422
滥情空心
滥情空心 2020-11-30 00:32

Upon installation of my Android program I check for device locale:

String deviceLocale=Locale.getDefault().getLanguage();

If deviceLocale i

7条回答
  •  醉梦人生
    2020-11-30 00:58

    To get the device locale use this

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

    and current.toString() will return you "en" "ar" etc

提交回复
热议问题