These is just a temporary fix as of now, I've been trying to add all contact number associated with same contact person inside android.provider.ContactsContract
.
I've added all contact number associated with same contact person inside beans by appending with delimiter(",")
which i can fetch back using Tokenizer
. But no idea to know which kinda contact type it is whether HOME, WORK, OFFICE , it's less important to me as of now.
Fix:
if (mimeType.equals(Phone.CONTENT_ITEM_TYPE)){
// set phone number
if (contact.getContactNumber().toString().length() == 0) {
contact.setContactNumber(cur.getString(cur.getColumnIndex(Phone.NUMBER)).replaceAll("\\D", ""));
} else {
contact.setContactNumber(contact.getContactNumber().toString().concat(", ").concat(cur.getString(cur.getColumnIndex(Phone.NUMBER)).replaceAll("\\D", "")));//One can add possible contacts "(-/,"
}
}