How to set the display of contact addresses from large to small (by province, city, or Street)

Source: Internet
Author: User

How to set the display of contact addresses from large to small (by province, city, or Street)
1. (modify the contact details page)
File: PostalSplitter. java (packages \ providers \ contactsprovider \ src \ com \ android \ providers \ contacts)
Function: public String join (Postal postal)
There are the following statements:
If (mLocale! = Null &&
JAPANESE_LANGUAGE.equals (mLocale. getLanguage ())&&
! ArePrintableAsciiOnly (values )){
Return joinJaJp (postal );
} Else {
Return joinEnUs (postal );
}
JoinEnUs (postal) is the display sequence from small to large, while joinJaJp (postal) is the display sequence from large to school,
Comment out the preceding statement and directly use return joinJaJp (postal); this allows you to return a large to small display format in any language,
You can also add similar system language judgment conditions in the format of JAPANESE_LANGUAGE.equals (mLocale. getLanguage.

2. (modify the contact editing interface)
In the following three files:
Before KK1
BaseAccountType. java (packages \ apps \ contacts \ src \ com \ android \ contacts \ model \ account)
ExchangeAccountType. java (packages \ apps \ contacts \ src \ com \ android \ contacts \ model \ account)
LocalPhoneAccountType. java (packages \ apps \ contacts \ src \ com \ mediatek \ contacts \ model)
After KK1
BaseAccountType. java (packages \ apps \ contactscommon \ src \ com \ android \ contacts \ common \ model \ account)
ExchangeAccountType. java (packages \ apps \ contactscommon \ src \ com \ android \ contacts \ common \ model \ account)
LocalPhoneAccountType. java (packages \ apps \ contactscommon \ src \ com \ mediatek \ contacts \ model)
The addDataKindStructuredPostal function is available. The following statement is used to set the sub-district and city:
If (useJapaneseOrder ){
... // From large to small
} Else {
... // Small to large
}
UseJapaneseOrder is: Locale. JAPANESE. getLanguage (). equsals (Locale. getDefault (). getLanguage ());
Similarly, you can set useJapaneseOrder to true to return a large to small display format in any language,
You can also add similar system language judgment conditions to the examples of Locale. JAPANESE. getLanguage (). equsals (Locale. getDefault (). getLanguage ();

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.