zoukankan      html  css  js  c++  java
  • 删除现有的Recipient再重新添加选中的Contacts

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(requestCode == TxrjConstant.REQUEST_ADD_CONTACT && resultCode == RESULT_OK) {
            ArrayList<TxrjContact> extraContacts = data
                    .getParcelableArrayListExtra(TxrjConstant.EXTRA_CONTACT_LIST);
            removeAllRecipientItems();
            mRecipients.clear();
            for (TxrjContact contact : extraContacts) {
                addRecipientItem(getRecipientItem(contact));
            }
        }
    }

    private void removeAllRecipientItems() {
        int count = mViewGroup.getChildCount();
        View view = null;
        TxrjContact contact = null;
        List<View> items = new ArrayList<View>();
        for (int i = 0; i < count - 2; i++) {
            view = mViewGroup.getChildAt(i);
            contact = (TxrjContact) view.getTag(R.id.tag_contact);
            if ((view instanceof TextView) && (contact != null)
                    && mRecipients.contains(contact)) {
                items.add(view);
            }
        }
        for (View item : items) {
            mViewGroup.removeView(item);
        }
    }

  • 相关阅读:
    转载:怎样用通俗的语言解释REST,以及RESTful?
    WiresShark 图解教程1
    派力奥 1.3 发动机
    EtherChannel Cisco 端口聚合详解
    Linux 排除问题的前5分钟
    Linux 定时任务crontab
    Linux SCP命令复制传输文件的用法
    Linux 挂载aliyun数据盘
    BCDedit 研究
    Bcdedit命令使用详解使用方法
  • 原文地址:https://www.cnblogs.com/fengzhblog/p/3189147.html
Copyright © 2011-2022 走看看