반응형
참조
https://stackoverflow.com/questions/14389349/android-get-current-locale-not-default
fun getCurrentLocale(context: Context): Locale? {
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
context.resources.configuration.locales.get(0)
} else {
@Suppress("DEPRECATION")
context.resources.configuration.locale
}
}
반응형