Horizontal screen switching for Android Simulators

Source: Internet
Author: User

If the android simulator has been started, you can use the shortcut key F12 or Ctrl + F11 to switch. Of course, you can use the command line to launch the simulator by using the receivemulator.exe-skin HVGA-L. (I also found that when my keypad is locked, I press 8 and then press 7, and the screen is landscape. Although I don't know why, I 'd like to add it here.) It should be noted that, the program will reload onCreate to avoid using androidmanifest. redefines the direction in the xml file and controls it according to the onConfigurationChanged (Configuration newConfig) method of the Activity. The ConfigChanges attribute of an Activity can be set to capture device status changes. The following content can be identified:

CONFIG_FONT_SCALECONFIG_MCCCONFIG_MNCCONFIG_LOCALECONFIG_TOUCHSCREENCONFIG_KEYBOARDCONFIG_NAVIGATIONCONFIG_ORIENTATION
Setting Method: Separate the following fields with the "|" symbol, for example, "locale | navigation | orientation" Value
Description "mcc"
The IMSI mobile country code (MCC) has changed-that is, a SIM hasbeen detected and updated the MCC. the mobile country number consists of three digits. Each country has its own independent MCC, which can identify the country to which the mobile phone user belongs. "Mnc"
The IMSI mobile network code (MNC) has changed-that is, a SIM hasbeen detected and updated the MNC. mobile network number, which is used to differentiate mobile phone users in a country or region. "Locale"
The locale has changed-for example, the user has selected a new language that text shoshould be displayed in. The region of the user changes. "Touchscreen"
The touchscreen has changed. (This shoshould never normally happen.) "keyboard"
The keyboard type has changed-for example, the user has plugged in an external keyboard. The keyboard mode changes, for example, the user accesses The external keyboard input. "KeyboardHidden"
The keyboard accessibility has changed-for example, the user has slid the keyboard out to expose it. The user opens the mobile hardware keyboard "navigation"
The navigation type has changed. (This shoshould never normally happen.) "orientation"
The screen orientation has changed-that is, the user has rotated the device. device rotation, horizontal display and vertical display mode switch. "FontScale"
The font scaling factor has changed-that is, the user has selected a new global font size. global font size scaling has changed. 1. When android: configChanges of Activity is not set, the split screen will re-call each lifecycle, and the split screen will be executed once, the image will be executed once when the portrait screen is switched, and some on the Internet say that the portrait screen is switched twice. I tried it only once on the Android 2.3 simulator and mobile phone. But it was tested on the simulator of android2.2. When the screen is switched to the portrait, two declaration cycles will be executed. 2. When setting the Activity's android: configChanges = "orientation", the screen will be switched back to call each lifecycle, and the screen will only be executed once during horizontal and vertical switching, onConfigurationChanged is also called when the screen is switched to the portrait. The simulator will follow the above instructions. If the mobile phone is used, the Declaration cycle will not be executed. Only onConfigurationChanged3 will be executed. When the android: configChanges = "orientation | keyboardHidden" of the Activity is set, the screen-cutting function does not call every lifecycle, but only executes the onConfigurationChanged method.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.