SoFunction
Updated on 2025-04-10

How to prohibit the transformation of horizontal and vertical screens on Android

How to prohibit the transformation of horizontal and vertical screens on Android

Updated: June 8, 2013 15:43:42 Author:
Android 4.0 prohibits horizontal and vertical screen switching to enable: android:configChanges="orientation|keyboardHidden|screenSize" Interested friends can learn about it
Android 4.0 prohibits horizontal and vertical screen switching android:configChanges="orientation|keyboardHidden" is invalid
In previous versions, the Activity was set in the Manifest file android:configChanges="orientation|keyboardHidden" but it was invalid in android4.0. Finally, I found that I needed to add another attribute: "screenSize"

Just change it to this: android:configChanges="orientation|keyboardHidden|screenSize"
  • Android
  • Horizontal screen
  • Vertical screen

Related Articles

  • Detailed explanation of the usage of android studio broadcast mechanism

    This article mainly introduces the usage method of Android studio broadcasting mechanism in detail. The sample code in the article is introduced in detail and has certain reference value. Interested friends can refer to it.
    2022-08-08
  • Add shortcuts and widget instances to Android Launcher launcher

    This article mainly introduces the method of adding shortcuts and widgets to Android Launcher launcher, including the example of adding widgets AppWidgets in your own application. Friends who need it can refer to it
    2016-02-02
  • Detailed explanation of Flutter learning to implement custom themes

    Generally speaking, the apps we build in flutter basically use the design pattern of MaterialApp. MaterialApp provides a unified style for the buttons, menus, etc. we use next. So can this style be modified or customized? The answer is yes, let's take a look
    2023-03-03
  • How to implement Android calling system cropping

    Below, the editor will share with you an implementation method of Android calling system cropping, which is of good reference value and hope it will be helpful to everyone. Let's take a look with the editor
    2018-02-02
  • Android App Application Startup Analysis and Optimization

    This article mainly introduces the analysis and optimization of Android App application startup for you in detail. Interested friends can refer to it.
    2016-07-07
  • Android uses ImageView to create transparent arc instance code

    This article mainly introduces the relevant information about Android using ImageView to create transparent arc instance code. Friends who need it can refer to it.
    2016-05-05
  • flutter TextField line break adaptive implementation

    This article mainly introduces the implementation of flutter TextField line-break adaptive. The article introduces the example code in detail, which has certain reference learning value for everyone's study or work. Friends who need it, please learn with the editor below.
    2020-02-02
  • How to determine network type of Android (2g, 3g or wifi)

    This article mainly introduces the method of Android to judge network types, which can achieve the function of judging 2g, 3g or wifi. It analyzes Android's relevant judgment skills for network types based on examples. Friends who need it can refer to it
    2016-02-02
  • Android implements cropping function

    This article mainly introduces the function of Android to crop photos in detail. The sample code in the article is introduced in detail and has a certain reference value. Interested friends can refer to it.
    2022-03-03
  • How to use the Android ListView list view

    This article mainly introduces in detail how to use Android ListView list view, which has certain reference value. Interested friends can refer to it.
    2019-01-01

Latest Comments