Android Input 8 or 6 will search for a contact with name and number without 6

Source: Internet
Author: User

This problem is because in the deposit of a domestic normal telephone number, in the database will be stored two, one is the original number, and the other is the number with the country code +86.
13900218888 +8613900218888
So you enter a 6 o'clock match to +86 of 6, but the actual number display is the number that you deposited to display, please be aware.

If you want to modify, please refer to the following methods:
FILE:DataRowHandlerForPhoneNumber.java
@Override
public void Appendsearchabledata (Indexbuilder builder) {
String number = builder.getstring (Phone.number);
if (textutils.isempty (number)) {
Return
}
String Normalizednumber = phonenumberutils.normalizenumber (number);
if (Textutils.isempty (Normalizednumber)) {
Return
}
Builder.appendtoken (Normalizednumber);

Modified for search number
String numberE164 = phonenumberutils.formatnumbertoe164 (
Number, Mdbhelper.getcurrentcountryiso ());
if (numberE164! = null &&!numbere164.equals (normalizednumber)) {
Builder.appendtoken (numberE164);
//    }
Modified for search number
}

Android Input 8 or 6 will search for a contact with name and number without 6

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.