Change the system display size programmatically Android N

后端 未结 3 1549
误落风尘
误落风尘 2020-12-16 02:04

Background: Android N comes with a feature to change system Display Size from settings, in addition to the previously present feature of changi

3条回答
  •  我在风中等你
    2020-12-16 02:42

    While referring Settings.System , there is a [putConfiguration(ContentResolver cr, Configuration config)](https://developer.android.com/reference/android/provider/Settings.System.html#putConfiguration(android.content.ContentResolver, android.content.res.Configuration)) method. Use of this method is:

    Convenience function to write a batch of configuration-related settings from a Configuration object.

    In Configuration

    This includes both user-specified configuration options (locale list and scaling) as well as device configurations (such as input modes, screen size and screen orientation).

    Set configuration with SCREENLAYOUT_SIZE_MASK values for screen size. It is:

    The SCREENLAYOUT_SIZE_MASK bits define the overall size of the screen. They may be one of SCREENLAYOUT_SIZE_SMALL, SCREENLAYOUT_SIZE_NORMAL, SCREENLAYOUT_SIZE_LARGE, or SCREENLAYOUT_SIZE_XLARGE.

    I hope its helps you.

提交回复
热议问题