Mms编辑短信时候联系人重复或者无效则删除解决方案
Posted vendor_api
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Mms编辑短信时候联系人重复或者无效则删除解决方案相关的知识,希望对你有一定的参考价值。
路径
packages\apps\Mms\src\com\android\mms\ui\ComposeMessageActivity.java
修改
private void updateTitle(ContactList list)
if (mConversation.isGroupChat()) { GroupChatModel groupChat = mConversation.getGroupChat(); if (groupChat != null) { title = RcsUtils.getDisplayName(groupChat); } else if (!mSentMessage) { title = getString(R.string.new_group_chat); } else { title = getString(R.string.group_chat); } subTitle = getString(R.string.group_chat) + mConversation.getGroupChatStatusText(); } else { //modify start if(mRecipientsEditor != null && list != null && list.size() > 0) { int size = list.size(); Contact lastContact = list.get(size - 1); //Find the last contact String name = lastContact.getName(); String number = lastContact.getNumber(); if (!(Mms.isEmailAddress(number) || Telephony.Mms.isPhoneNumber(number))) { //Add contact error list.remove(size - 1); mRecipientsEditor.populate(list); String title2 = getResourcesString(R.string.has_invalid_recipient, name); Toast.makeText(ComposeMessageActivity.this, title2, Toast.LENGTH_SHORT).show(); return; } if(size > 1){ for(int i = 0; i < size - 1; i++) { if(number.equals(list.get(i).getNumber())){ //Repeat the contact list.remove(size - 1); mRecipientsEditor.populate(list); String title2 = getResourcesString(R.string.has_invalid_recipient, name); Toast.makeText(ComposeMessageActivity.this, title2, Toast.LENGTH_SHORT).show(); return; } } } } //modify end
以上是关于Mms编辑短信时候联系人重复或者无效则删除解决方案的主要内容,如果未能解决你的问题,请参考以下文章