I've faced with behavior which I'm unable to explain by using android official reference to resource resolution strategy. I'm using Android 7.1.1.
My app has following resources:
And the list of system languages is the following:
The problem: according to Resource Resolution example I'm expecting that app configuration locale (Resources.Configuration.Locale) will be en - the default locale. But surprisingly Android keeps be_BY. When the order of these two languages is reverted (1. kk_KZ, 2. be_BY), Android changes configuration locale to be_BY, despite the fact my app doesn't have neither be_BY nor kk_KZ resources at all. After that app is referencing to en resources.
As soon as I've added values-be-rBY and values-kk-rKZ folders to my app project Android has become set locale properly - be_BY for list of languages
and kk_KZ for list of languages
Based on this fact I assume Android sets app locale depending on its specified resources, but it contradicts with described problem
So, here is my question: is my understanding correct? Why it behaves so?
Finally I've figured it out. My app uses Google Play Services which have be_BY localization but don't have kk_KZ localization. And resources are also put into resources.arsc file. So, after Android fails to find kk_KZ resources, it tries the next language - be_BY in my case and stops search at be_BY locale. I've also checked this in Android Studio demo app and found that its behavior is the same. So, it seems it is a native behavior.