Is there a way to know exactly which layout (and other resources) are chosen by Android during runtime based on screen density and size when supporting multiple screens?
I need to know the folder's name.
EDIT:
I need to know the folder's name programmatically.
If you're just doing this for debugging purposes, I'd recommend doing something like this: For each qualifier that you have a layout/drawable for, have a values folder with the same qualifier (e.g. if you have a layout-hdpi, also have a values-hdpi to match). Add a strings.xml for each of these folders, and define a string:
In values-hdpi
:
<string name="folder_name">hdpi</string>
In values-xhdpi
:
<string name="folder_name">xhdpi</string>
Then just resolve the string when you need it, and it will tell you which folder was selected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With