androidandroid-screen-supportmulti-window

dimens.xml for multi window mod


My app supports multi window feature. I want the app to take dimensions from different dimens.xml files when the app is in normal mode and multi window mode.

I have declared the minWidth = 255dp and minHeight = 600dp.

I have declared the dimens-h600dp.xml and dimens.xml files but the app takes the values from only dimens-h600dp.xml in any mode.

How can I make the app to take dimensions from different dimens.xml files when the app is in normal mode and multi window mode ?


Solution

  • You are specifically opting out of configuration changes for screen sizes. As a result, nothing will happen automatically to force you to take on new resource values when the app enters or exits split-screen mode.

    I recommend removing android:configChanges. Android will then recreate your activities and fragments when a configuration change occurs, and you will pick up the revised resources at that point.