Android System Modification time format is 24-hour

Source: Internet
Author: User

1. Frameworks/base/packages/settingsprovider/res/values/defaults.xml

Add <stringname= "time_12_24" >12</string>//24-hour change to 24

2. Frameworks/base/packages/settingsprovider/src/com/android/providers/settings/databasehelper.java file,

In the Loadsystemsettings () method, add

Loadstringsetting (stmt,settings.system.time_12_24,r.string.time_12_24);

3. "Settings-" date and time-"use 24-hour format, modify default to open"

Frameworks\base\core\java\android\text\format\dateformat.java

Switch

public static Booleanis24hourformat (context context) {

String value = Settings.System.getString (Context.getcontentresolver (),

SETTINGS.SYSTEM.TIME_12_24);

if (value ==null) {

Settings.System.putString (Context.getcontentresolver (),

Settings.System.TIME_12_24, "24");

Value = "24";

}

Returnvalue.equals ("24");

}


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android System Modification time format is 24-hour

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.