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 ();