checked title field i am sure it is empty and no space.
suggest to trim the title filed before put ','
disply',' if title is empty?
Re: disply',' if title is empty?
Code: Select all
if (TextUtils.isEmpty(company)) {
combined = displayNameIsOrganization ? null : title;
} else {
if (TextUtils.isEmpty(title)) {
combined = displayNameIsOrganization ? null : company;
} else {
if (displayNameIsOrganization) {
combined = title;
} else {
combined = context.getString(
R.string.organization_company_and_title, company, title);
}
}
}
-
- Posts: 47
- Joined: Sat Sep 28, 2013 1:29 am
Re: disply',' if title is empty?
呵呵,n多年没有做coding了。不知道android里有没有trim这样的功能,就是如果有一个string :space+space+ABC+space+space,trim以后就只有ABC了,可以把space弄掉。 这样就不会遗留一个空白的space的问题。
Re: disply',' if title is empty?
这里没有使用trim。只是判断String是否为空。因此有空格会导致“,”出现。我之前是这样回答的。
-
- Posts: 47
- Joined: Sat Sep 28, 2013 1:29 am
Re: disply',' if title is empty?
建议使用trim,以前做coding的时候,我们判断string都是先trim一下,再判断的,不然A和A+space会不一样。
Re: disply',' if title is empty?
恩谢谢!有较多联系人出现这个情况吗?如果是个别建议修改一下联系人。因为是手机我想减少不必要的代码。
-
- Posts: 47
- Joined: Sat Sep 28, 2013 1:29 am
Re: disply',' if title is empty?
不是很多,是大多联系人有这个问题,因为大多都联络人是只有公司,没有职位。devin wrote:恩谢谢!有较多联系人出现这个情况吗?如果是个别建议修改一下联系人。因为是手机我想减少不必要的代码。
所以至少这段码用trim处理一下。
Re: disply',' if title is empty?
好的,但是在我的手机没有这个问题。因为当联系人没有职位,相关的字段将是空,而不是空格。
-
- Posts: 47
- Joined: Sat Sep 28, 2013 1:29 am
Re: disply',' if title is empty?
其实应该是空的,不知道为什么会是空格。devin wrote:好的,但是在我的手机没有这个问题。因为当联系人没有职位,相关的字段将是空,而不是空格。
Re: disply',' if title is empty?
恩,我已经修改它。并做一些优化在t9搜索,如果有时间,请试试它。
http://www.dw-p.net/dl/DW-Contacts-Phone-test.apk
http://www.dw-p.net/dl/DW-Contacts-Phone-test.apk
-
- Posts: 47
- Joined: Sat Sep 28, 2013 1:29 am
Re: disply',' if title is empty?
ok了,谢谢。devin wrote:恩,我已经修改它。并做一些优化在t9搜索,如果有时间,请试试它。
http://www.dw-p.net/dl/DW-Contacts-Phone-test.apk
不过backup和restore还是要手改文件路径,可否像settting restore一样有file browser功能,可以自己选。
-
- Posts: 47
- Joined: Sat Sep 28, 2013 1:29 am
Re: disply',' if title is empty?
using test version now, not sure why it has 'system not responding' problem very often.
do you know why?
do you know why?
Re: disply',' if title is empty?
What is the function you are using?
Please try this final version.
http://www.dw-p.net/dl/DW-Contacts-Phone.apk
Please try this final version.
http://www.dw-p.net/dl/DW-Contacts-Phone.apk
-
- Posts: 47
- Joined: Sat Sep 28, 2013 1:29 am
Re: disply',' if title is empty?
I donot use any complicate function, just start dialer, then the system show me unresponding and it is very often.
-
- Posts: 47
- Joined: Sat Sep 28, 2013 1:29 am
Re: disply',' if title is empty?
I donot use any complicate function, just start dialer, then the system show me unresponding and it is very often.
Re: disply',' if title is empty?
Please try this final version
http://www.dw-p.net/dl/DW-Contacts-Phone.apk
http://www.dw-p.net/dl/DW-Contacts-Phone.apk