Wrong resource folder being chosen by Android system
I've been having problems with my app on a 7 inch device. For debugging
purposes I've added a toast message that displays after the app loads, to
tell me which resource folder the app is using, ie. which qualifiers. I
have strings.xml files in each of the following resource folders:
values
values-normal
values-large
values-xlarge
values-sw600dp
values-sw720dp
The content of the string used by the toast message is based on the folder
in which the string is located. I also have six layout folders with the
same qualifiers as above, and I have valid layout xml files in all six of
the layout folders. My app works perfectly on 'normal' screens and 10 inch
tablet screens.
The troublesome 7 inch device (my mate's) is a cheap 'Audiosonic' running
Android 4.1.1. Apparently the resolution is 800x480, and the physical
smallest width of the screen is 86mm, or 3.4 inches. This means 142dpi.
Given the equation dp = (pixels x 160) / dpi The smallest width should be
541dp.
Now here comes the crazy part, and my question...why on earth are the
sw720dp resources being used by my app on this 7 inch device?!
No comments:
Post a Comment