Android resources “best match” fallback logic

折月煮酒 提交于 2019-12-01 11:08:40

Yes it looks first in the drawable-en, then drawable-hdpi because language qualifier has higher precedence. If value was still not found drawable directory is searched. It is in accordance with: How Android Finds the Best-matching Resource

If drawable-en contains matching resource then drawable-hdpi and drawable would be eliminated based on step 4 of the algorithm.

I read the intro portion

assume the following drawable directories each contain different versions of the same images

In your example Android would ignore the drawable-en-port folder because it does not have that drawable name in it. It would only look in the folders that have that drawable, therefore selecting the best matching folder. It would only select 'drawable' if there were no folders with a matching configuration and image.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!