Both of these sizes pull from the same layout folder. So…I am wondering how I can create widget that looks good on both? I have attached screen shots to show the 2 displays that are pulling the same resources.


Any ideas?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In Android the layout was chosen based on the density of the Devices Different Screen Configuration for eg:
(ldpi) screens (~120dpi).
(mdpi) screens (~160dpi).
(hdpi) screens (~240dpi).
(xhdpi) screens (~320dpi).
Both 960×540 and 854×480 falls in hdpi layout , so you are getting same layout for both one.
To solve this issues , to get apt UI for both specification create separate XML for both inside hdpi-layout. for eg: 960_540.xml and 854_480.xml
In Activity check the Screen Size of Device so that set corresponding ContentView
You can get Screen Size using Display Metrics below Code :