I’ve read the docs about Android Resources and I think I’ve understood the best-matching logic used by android to identify in which directory a particular resource should be searched first.. Supposing that drawable-hdpi, drawable-en-port and drawable-en* match the current device configuration, drawable-en-port is the best matching directory.. My question is, if a drawable is not found in drawable-en-port, does the system look directly in drawable or does it look in the second-best-match drawable-en and then in the third best match drawable-hdpi and so on until it reaches drawable? I suppose it works this way, but I did not find it explicitly said in the docs (unless I’ve read them too quickly and you will surely kill me 🙂 ).
I’ve read the docs about Android Resources and I think I’ve understood the best-matching
Share
Yes it looks first in the
drawable-en, thendrawable-hdpibecause language qualifier has higher precedence. If value was still not founddrawabledirectory is searched. It is in accordance with:How Android Finds the Best-matching Resource
If
drawable-encontains matching resource thendrawable-hdpianddrawablewould be eliminated based on step 4 of the algorithm.