I’ve main.xml in layout and layout-xlarge folder. In phones with wider screens like Galaxy Note, I would like to use main.xml from layout-xlarge folder. How can I redirect the android system to use that specific layout file dynamically from code based on condition?
For eg : if some condition is true, then use main.xml file from layout folder and if false use main.xml from layout-xlarge folder.
You can’t do that any how you don’t want to redirect the Android system if you are using XHDPI devices it will take from layout-xhdpi.. Say for example Samsung S3 it will takes layout as layout-xhdpi.. It always depends on Devices Densities.
Say if DPI is 120dpi – layout-ldpi
DPI is 160dpi – layout-mdpi
DPI is 240 & 256dpi – layout-hdpi
DPI is >256dpi – layout-xhdpi
All above given values is approximately.