Comparing phone numbers in Android

前端 未结 4 1243
故里飘歌
故里飘歌 2020-12-06 11:06

I need to compare two phone numbers to determine if they\'re from the same sender/receiver. The user may send a message to a contact, and that contact may reply.

The

4条回答
  •  再見小時候
    2020-12-06 11:50

    How about checking if the number is a substring of the receiver's number?

    For instance, let's say my Brazilian number is 888-777-666 and yours is 111-222-333. To call you, from here, I need to dial additional numbers to make international calls. Let's say I need to add 9999 + your_number, resulting in 9999111222333.

    If RawNumber.substring(your_number) returns true I can say that I'm calling you.

提交回复
热议问题