Android Default time format modification method _android
Source: Internet
Author: User
In Android use, when you encounter a change in the default time format, always helpless, this article will provide a solution to this problem, need to understand the friend can refer to the following
Language for English, the default time format for mm/dd/yyyy, how to change the default time format to: dd/mm/yyyy, do not know whether the framework layer to initialize or compile the time to give the initial value, which heroes know how to do?
1. Modify the document
Alps\frameworks\base\packages\settingsprovider\res\values\defaults.xml
Add code <string name= "Time_12_24" translatable= "false" >24</string>
The red mark represents a 24-hour system, or it can be changed to 12 (12-hour system).
2. Modify File Alps\frameworks\base\packages\settingsprovider\src\com\android\providers\settings\databasehelper.java
Locate the function loadsystemsettings () and add the following statement to the function:
Loadstringsetting (stmt, Settings.System.TIME_12_24, r.string.time_12_24);
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.