Android manifest. xml option-Android: configchanges

Source: Internet
Author: User

Configchanges attribute usage in Activity

By setting this attribute, activity can capture device status changes. The following content can be recognized:

Config_font_scale

Config_mcc

Config_mnc

Config_locale

Config_touchscreen

Config_keyboard

Config_navigation

Config_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 hardware keyboard of the mobile phone.
"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. The Global font size scaling changes

An example is provided to describe how to use this property: First, you need to modify the manifest of the project:
? View code XML

<ManifestXmlns: Android = "http://schemas.android.com/apk/res/android"
Package = "com. androidres. configchangedtesting"
Android: versioncode = "1"
Android: versionname = "1.0.0">
<ApplicationAndroid: icon = "@ drawable/icon" Android: Label = "@ string/app_name">
<ActivityAndroid: Name = ". configchangedtesting"
Android: Label = "@ string/app_name"
Android: configchanges = "keyboardhidden | orientation">
<Intent-Filter>
<ActionAndroid: Name = "android. Intent. Action. Main"/>
<CategoryAndroid: Name = "android. Intent. Category. launcher"/>
</Intent-Filter>
</Activity>
</Application>
</Manifest>

The Android: configchanges attribute is added to the activity to notify the program to call the onconfigurationchanged () function when the specified attribute (configuration changes) changes.

Related Article

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.