android:configchanges= "Locale"

Source: Internet
Author: User

android:configchanges="Locale"

After you switch to settings without exiting the app, you'll see that the activity is restarted.

4.2, when the app is configured with the Configchanges locale attribute, when the app is in the background and there is no finish, if you change the language, the activity override's onconfigurationchanged function is not called at resume.

The reason is that 4.2 adds a layoutdirection attribute that, when changed, will also be a mask bit in newconfig. So Activitymanagerservice (actually in activitystack) always judges the restart when deciding whether to restart the activity. When inThe app expects things to happen when both locale and layoutdirection are added to the android:configchanges. the SDK documentation has:
"orientation" The screen orientation have changed-the user has rotated the device.

Note: If your application targets API level A or higher ( minSdkVersion targetSdkVersion as declared by the and attributes), then you should also D Eclare "screenSize" the configuration, because it also changes when a device switches between portrait and landscape orientations .

But there is no explanation in the locale. There should also be a similar description in the locale.

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.