diff --git a/app/src/main/java/com/f1x/mtcdialer/PhoneBookActivity.java b/app/src/main/java/com/f1x/mtcdialer/PhoneBookActivity.java index c60c9d8..79c8243 100644 --- a/app/src/main/java/com/f1x/mtcdialer/PhoneBookActivity.java +++ b/app/src/main/java/com/f1x/mtcdialer/PhoneBookActivity.java @@ -48,9 +48,10 @@ protected void onServiceConnected() { private void buildPhoneBook(List phoneBookRecords) { for(String phoneBookRecord : phoneBookRecords) { String[] parsedRecord = phoneBookRecord.split("\\^"); + String contactName = parsedRecord[0].replaceAll("\\s+", " ").replaceAll("\\s+$", ""); String phoneNumber = parsedRecord[1].replaceAll("[^\\d\\+]", ""); - mPhoneBookRecords.put(parsedRecord[0], phoneNumber); + mPhoneBookRecords.put(contactName, phoneNumber); } }