Is it possible to set the screen size of the device as small, normal, and large by code?

Asked 2 years ago, Updated 2 years ago, 73 views

Is it possible to set the screen size of the device as small, normal, large, and xlarge with the code? Not density, just screen size.

android android-screen-support screen

2022-09-22 22:28

1 Answers

Configuration.Try screenLayout.

if ((getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == Configuration.SCREENLAYOUT_SIZE_LARGE) {
            // // on a large screen device ...
          }


2022-09-22 22:28

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.