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