編輯:關於Android編程
怎麼去掉聯系人、通話記錄、撥號列表界面中的電話號碼中間的空格? 去掉空格也就是去掉號碼格式化,對所有的號碼串將不進行號碼格式化。 1. 注解掉格式化處理
* If the given number doesn't have the country code, the phone will be
* formatted to the default country's convention.
*
* @param phoneNumber
* the number to be formatted.
* @param defaultCountryIso
* the ISO 3166-1 two letters country code whose convention will
* be used if the given number doesn't have the country code.
* @return the formatted number, or null if the given number is not valid.
*
* @hide
*/
public static String formatNumber(String phoneNumber, String defaultCountryIso) { // Before modified
// // Do not attempt to format numbers that start with a hash or star symbol.
// if (phoneNumber.startsWith(#) || phoneNumber.startsWith(*)) {
// return phoneNumber;
// } // PhoneNumberUtil util = PhoneNumberUtil.getInstance();
// String result = null;
// try {
// PhoneNumber pn = util.parseAndKeepRawInput(phoneNumber, defaultCountryIso);
// result = util.formatInOriginalFormat(pn, defaultCountryIso);
// } catch (NumberParseException e) {
// }
// return result; // After modified
return phoneNumber; // Just return, don't format the phoneNumber
} 4. 去掉導入號碼時的格式化處理代碼 FILE: AbstractStartSIMService.java
PATH: alps/packages/apps/contacts/src/com/mediatek/contacts/Simcontact (1) 去掉 actuallyImportOneSimContact() 方法中對 phoneNumber 的格式化處理代碼 :
---------------------------------------------------------------------------------------------------------------------------
/*
* Bug Fix by Mediatek Begin. Original Android's code: xxx
* CR ID: ALPS00289127 Descriptions:
*/
Log.i(TAG, [actuallyImportOneSimContact] phoneNumber before : + phoneNumber);
// AsYouTypeFormatter mFormatter = PhoneNumberUtil.getInstance()
// .getAsYouTypeFormatter(countryCode);
// char[] cha = phoneNumber.toCharArray();
// int ii = cha.length;
// for (int num = 0; num < ii; num++) {
// phoneNumber = mFormatter.inputDigit(cha[num]);
// }
Log.i(TAG, [actuallyImportOneSimContact] phoneNumber after : + phoneNumber);
/*
* Bug Fix by Mediatek End.
*/ (2) 去掉 actuallyImportOneSimContact() 方法中對 additionalNumber 的格式化處理代碼:
---------------------------------------------------------------------------------------------------------------------------
/*
* Bug Fix by Mediatek Begin. Original Android's code:
* xxx CR ID: ALPS00289127 Descriptions:
*/
Log.i(TAG, [actuallyImportOneSimContact] additionalNumber before :
+ additionalNumber);
// AsYouTypeFormatter mFormatter = PhoneNumberUtil.getInstance()
// .getAsYouTypeFormatter(countryCode);
// char[] cha = additionalNumber.toCharArray();
// int ii = cha.length;
// for (int num = 0; num < ii; num++) {
// additionalNumber = mFormatter.inputDigit(cha[num]);
// }
Log.i(TAG, [actuallyImportOneSimContact] additionalNumber after :
+ additionalNumber);
/*
* Bug Fix by Mediatek End.
*/
--------------------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------------------------------
1.普通側滑效果圖:思路:通過自定義View繼承HorizontalScrollView,然後重寫onMeasure(),onLayout(),onTouchEvent(
前言上一篇我們了解了HTTP協議原理,這一篇我們來講講Apache的HttpClient和Java的HttpURLConnection,這兩種都是我們平常請求網絡會用到的
(轉載請注明出處:http://blog.csdn.net/buptgshengod) 1.背景 在android源碼中我們能看到各種以@開頭的字符,他們大
在實際的開發中,很多時候還會遇到相對比較復雜的需求,比如產品妹紙或UI妹紙在哪看了個讓人興奮的效果,興致高昂的來找你,看了之後目的很明確,當然就是希望你能給她;在這樣的關