Skip to content

Commit

Permalink
Trim contact name
Browse files Browse the repository at this point in the history
  • Loading branch information
bezloginu committed Jun 22, 2017
1 parent 8093f7c commit 9830c10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/main/java/com/f1x/mtcdialer/PhoneBookActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ protected void onServiceConnected() {
private void buildPhoneBook(List<String> phoneBookRecords) {
for(String phoneBookRecord : phoneBookRecords) {
String[] parsedRecord = phoneBookRecord.split("\\^");
String contactName = parsedRecord[0].replaceAll("\\s+", " ").replaceAll("\\s+$", "");
String contactName = parsedRecord[0].trim().replaceAll(" +", " ");
String phoneNumber = parsedRecord[1].replaceAll("[^\\d\\+]", "");

mPhoneBookRecords.put(contactName, phoneNumber);
Expand Down

0 comments on commit 9830c10

Please sign in to comment.