Search code examples
androidandroid-manifestandroid-configchanges

Why screenSize changes when the user switches between landscape and portrait?


According to Android guide "screenSize" changes when user rotates the device, why isn't "orientation" value enough to indicate that?

Link to android guide of activity tag


Solution

  • The screenSize configuration change doesn't mean that the physical screen has been changed, but it means that the dimensions of the logical screen have. For instance, the DisplayMetrics.widthPixels value will be much larger after a rotation from portrait to landscape.

    One thing to consider is that both the screenSize configuration change type and the smallest width and available width resource qualifiers were both added in API level 13. The available width of your screen changes when you rotate your device, so it makes sense that this would be flagged as a "screen size" change.