首页 > 代码库 > Mms编辑短信时候联系人重复或者无效则删除解决方案
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编辑短信时候联系人重复或者无效则删除解决方案
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。