Introduction to Android Android:configchanges

Source: Internet
Author: User

Androidmanifest.xml file, when declaring the activity, there will be a property set that is Android:configchanges, now let's briefly introduce the following:

When the program is running, some device configuration may change, such as: the switch of the screen, the availability of the keyboard, and so on, the activity will restart, the process is: before the destruction will be called onsaveinstancestate () Go to save some data from your app, then called OnDestroy () and finally go to called onCreate () or Onrestoreinstancestate () method to restart activity.
When this property is specified, the activity is not restarted, but instead notifies the program to invoke the Onconfigurationchanged () function, for example, when the activity is restarted while the screen is being toggled, the property is defined. Instead of restarting the activity, call the onconfigurationchanged () function, which can set multiple property values, separated by |, and the following are the meanings that each attribute value represents:
                                                                                                                                                                                           
"MCC" International Mobile user identification number of the country code is changed-----SIM was detected, to update the MCC MCC is the mobile user's country code
"MNC" International mobile Subscriber identification number is changed------SIM is detected, to update MNC MNC is a mobile network number, up to two digits, to identify mobile users belong to the mobile communication network
"Locale" Address changed-----user selected a new language will be displayed
"Touchscreen" touch screen is changed------usually not happen
The "keyboard" keyboard has changed----such as a user using an external keyboard
The usability of the "Keyboardhidden" keyboard has changed
The "navigation" navigation has changed-----usually does not occur
The display of the "screenlayout" screen has changed------different displays are activated
The "Fontscale" font scale has changed----Select a different global font
The mode of the "Uimode" user has changed
The "Orientation" screen direction changed.
The "screensize" screen size has changed
The physical size of the "smallestscreensize" screen has changed, such as: Connecting to an external screen

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.