Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/207.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/linq/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
android联系人未格式化和格式化的号码_Android_Android Contacts_Phone Number_Invisible - Fatal编程技术网

android联系人未格式化和格式化的号码

android联系人未格式化和格式化的号码,android,android-contacts,phone-number,invisible,Android,Android Contacts,Phone Number,Invisible,三星Galaxy S6 Edge、安卓6.0.1、微软Exchange主动同步 在我的应用程序中,我列举了一个人的所有电话号码。对于某些人,手机号码会列出两次,一次是在Outlook中输入号码时使用的(手动)格式,另一次是删除所有格式 正确输入和显示:010-123 45 67 对一些人来说,我的应用程序也会得到:0101234567。 如果我给那个人发短信,而安卓似乎记住了那个号码,并将其无形地保存在通讯录中,就会显示这个信息 如果我在Outlook Contacts和phone Contac

三星Galaxy S6 Edge、安卓6.0.1、微软Exchange主动同步

在我的应用程序中,我列举了一个人的所有电话号码。对于某些人,手机号码会列出两次,一次是在Outlook中输入号码时使用的(手动)格式,另一次是删除所有格式

正确输入和显示:010-123 45 67 对一些人来说,我的应用程序也会得到:0101234567。 如果我给那个人发短信,而安卓似乎记住了那个号码,并将其无形地保存在通讯录中,就会显示这个信息

如果我在Outlook Contacts和phone Contacts中查找此人,则只能看到格式化的号码


有没有关于如何删除未格式化数字的线索?

解决了这个问题,尽管我相信有更好的方法

phoneNumber = phoneCursor.getString(phoneCursor.getColumnIndex(NUMBER));
String stripped = stripSeparators(phoneNumber);
int count = theNumbers.size();
boolean present = false;
for (int i = 0; i < count; i++)
{
  if (stripSeparators(theNumbers.get(i)).equals(stripped) == true)
  {
    present = true;
    break;
  }
}
if (present == false)
  theNumbers.add(phoneNumber);
phoneNumber=phoneCursor.getString(phoneCursor.getColumnIndex(NUMBER));
String stripped=条带分隔符(phoneNumber);
int count=numbers.size();
布尔存在=假;
for(int i=0;i
解决了这个问题,尽管我确信有更好的方法

phoneNumber = phoneCursor.getString(phoneCursor.getColumnIndex(NUMBER));
String stripped = stripSeparators(phoneNumber);
int count = theNumbers.size();
boolean present = false;
for (int i = 0; i < count; i++)
{
  if (stripSeparators(theNumbers.get(i)).equals(stripped) == true)
  {
    present = true;
    break;
  }
}
if (present == false)
  theNumbers.add(phoneNumber);
phoneNumber=phoneCursor.getString(phoneCursor.getColumnIndex(NUMBER));
String stripped=条带分隔符(phoneNumber);
int count=numbers.size();
布尔存在=假;
for(int i=0;i
该链接不起作用一个快速而肮脏的解决方案:String stripped=stripeseparator(phoneNumber);如果(stripped.equals(phoneNumber)==false),则number.add(phoneNumber);但是,必须有更好的方法,因为我的通讯簿中可能有未格式化的号码,如果是,它们将被排除在外。看一看,这个链接不起作用。一个快速而肮脏的解决方案:String stripped=stripeseparators(phoneNumber);如果(stripped.equals(phoneNumber)==false),则number.add(phoneNumber);但是,必须有更好的方法,因为我的通讯簿中可能有未格式化的号码,如果是,它们将被排除在外。看一看,这只有在数字按一定顺序出现时才起作用。我已经解决了这个问题,首先收集所有的数字,然后搜索重复的数字。不漂亮。只有当数字按一定顺序出现时,这才有效。我已经解决了这个问题,首先收集所有的数字,然后搜索重复的数字。不漂亮。