简体   繁体   English

相同的Android联系人电话号码格式不同

[英]Different format for same Android contact phone number

So let's say the SMS conversation is like this: 假设SMS对话如下:

  1. hey nice to meet you (sent by me) 嘿,很高兴认识你(由我发送)
  2. yea nice to meet you too (received) 是的,也很高兴认识你(收到)
  3. let's hang out sometime (replied by me) 让我们出去玩吧(我回复)

The numbers associated with the other person look like this (by checking msg details): 与其他人关联的号码如下所示(通过检查味精详细信息):

  1. 4161234567 4161234567
  2. +14161234567 +14161234567
  3. +14161234567 +14161234567

The number stored in my contact's info is (1). 我的联系人信息中存储的号码是(1)。 How would I access all SMS between myself and this contact all at once? 我将如何一次访问自己与该联系人之间的所有SMS?

This may sound crude, but I'd adwise to change to the format in which you receive the text. 这听起来可能很粗糙,但我还是明智地更改为您接收文本的格式。 Reasoning behind it is ,that if you go abroad and need to text this person, there will be a problem, since there will be no country data to go along with this number. 其背后的原因是,如果您出国并需要发短信给此人,则会出现问题,因为此号码不会附带任何国家/地区数据。

If you want to do this programmatically, I would suggest a regexp, that checks the length of the number, and whether or not there is a country code in front of it. 如果要通过编程方式执行此操作,建议使用一个正则表达式,该规则可检查数字的长度以及其前面是否有国家/地区代码。 If no, check the contacts to see if there is a number like this with the country code, and use that instead. 如果否,请检查联系人以查看是否存在带有国家代码的类似数字,然后改用该数字。

我通过检索thread_id解决了这个问题,从而消除了电话号码稍有不同的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM