博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
android 在新建短信时,加入名称为","(英文逗号)的联系人时,应用崩溃
阅读量:4044 次
发布时间:2019-05-24

本文共 770 字,大约阅读时间需要 2 分钟。

请修改文件
/alps/frameworks/ex/chips/src/com/android/ex/chips/RecipientAlternatesAdapter.java
private static Cursor queryAddressData(Context context, ArrayList<String> addressesList,  int addressType)
把这里:
                /// M: Support recognizing two kinds of separator. @{
                char[] seperatorArr = {',', ';'};
                int indexOfSeparator = -1;
                int cnt = 0;
                while ((indexOfSeparator == -1) && (cnt <= seperatorArr.length)) {
                    indexOfSeparator = phoneStr.indexOf(seperatorArr[cnt]);
                    cnt++;
                }
                if (indexOfSeparator != -1) {
                    phoneStr = phoneStr.substring(0, indexOfSeparator); /// M: Get string before separator
                } else {
                    continue;
                }
改:
                /// M: Support recognizing two kinds of separator. Remove comma and semicolon at the end of address if exists. @{
                phoneStr = phoneStr.replaceAll("([, ]+$)|([; ]+$)","");

转载地址:http://ucedi.baihongyu.com/

你可能感兴趣的文章
设计模式(13) - Strategy策略模式
查看>>
设计模式(14) - State状态模式
查看>>
设计模式(15) - Observer观察者模式
查看>>
设计模式(18) - Command命令模式
查看>>
Fedora16/RedHat6.4下配置samba
查看>>
C++中const对象引用做为形参
查看>>
C++11使用lambda操作std::map
查看>>
VMware下Linux以NAT方式上网
查看>>
RHEL6.4编译安装gcc4.8.1
查看>>
C++11线程指南(1)--创建线程
查看>>
C++11线程指南(2)--Lambda线程实现
查看>>
C++11线程指南(3)--右值与左值
查看>>
C++11线程指南(4)--右值引用与移动语义
查看>>
C++11线程指南(5)--线程的移动语义实现
查看>>
C++11线程指南(6)--共享内存与互斥
查看>>
C++11线程指南(7)--资源竞争条件
查看>>
C++11线程指南(8)--死锁
查看>>
算法与数据结构概述
查看>>
select, poll, epoll详解(一)
查看>>
select, poll, epoll详解(二)
查看>>