Android 4.0 system language presets

Source: Internet
Author: User

When I was working on a traditional Android 4.0 Project, I received a language problem. After the mobile phone was initialized, it started to display traditional Chinese. However, as the network signal appeared, the language was changed to simplified Chinese. I am very confused. After reading the mcctalbe. Java file code (telephone module), I found that I would read two attributes, as shown below:

String L = systemproperties. Get ("Persist. SYS. Language"); string c = systemproperties. Get ("Persist. SYS. Country ");

Without these two attributes, the system language will be changed with the language of your SIM card, that is why the system language changes after the signal occurs.

Then the factory language is set through attributes, as shown below:

Compile the script path:/build/tools/buildinfo. Sh

Ro. Product. locale. Language = $ product_default_language

Ro. Product. locale. region = $ product_default_region

Finally, append the missing "Persist. SYS. Language" and "Persist. SYS. Country" attributes to the end of the script to compile the system. The test is successful.

In summary, the user will also call the activitymanagerservice. Java class to write the persist. SYS. Language attribute when actively changing the language settings.

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.