首页新闻找找看学习计划

请问 在ListView中有多个EditText,初始页面用adapter向里传值了,当编辑时怎么让输入的内容替换原来的内容?

0
[已关闭问题] 关闭于 2017-11-27 09:00

请问下:

 在ListView中有多个EditText,初始页面用adapter向里传值了,,当编辑时怎么让输入的内容替换原来的内容?

多谢

以下是部分代码:

 1   @Override
 2     public View getView(int position, View convertView, ViewGroup parent){
 3         final NFCPointAdapter.ViewHolder holder;
 4         if(convertView == null){
 5             //使用自定义的list_items作为Layout
 6             convertView = LayoutInflater.from(mContext).inflate(mResource, parent, false);
 7             //使用减少findView的次数
 8             holder = new NFCPointAdapter.ViewHolder();
 9             holder.itemTitle = ((TextView) convertView.findViewById(mTo[0]));
10             holder.item1_1 = ((TextView) convertView.findViewById(mTo[1]));
11             holder.item1_2 = ((TextView) convertView.findViewById(mTo[2]));
1      holder.item7_1 = ((TextView) convertView.findViewById(mTo[14]));
2      holder.item7_2 = ((EditText) convertView.findViewById(mTo[15]));
3 
4             //设置标记
5             convertView.setTag(holder);

activity:

1 ListView listView = (ListView) findViewById(R.id.list);
2                 NFCPointAdapter nfcPointAdapter = new NFCPointAdapter(NFCPointActivity.this, list,
3                         R.layout.search_nfc_point_item, new String[] {"itemTitle","item1", "item2", "item3","item4","item5","item6","item7","item8","item9","item10","item11","item12","patrolEndReason","item13","item14"}, new int[] { R.id.text1,R.id.item1_1,
4                         R.id.item1_2, R.id.item2_1,R.id.item2_2,R.id.item3_1,R.id.item3_2,R.id.item4_1,R.id.item4_2,R.id.item5_1,R.id.item5_2,R.id.item6_1,R.id.item6_2,R.id.text2,R.id.item7_1,R.id.item7_2}
5                 );
6                 listView.setAdapter(nfcPointAdapter);
7 
8                 
9                 errorReason = (EditText) findViewById(R.id.item7_2);

想用这两个,但有错,又没报错

errorReason.addTextChangedListener(new errorReasonTextChangeListener());
errorReason.setOnFocusChangeListener(new errorReasonFocusChangeListener());
想问一下 ,该怎么实现,能否提供一下思路或者demo,多谢

mx夕酉的主页 mx夕酉 | 菜鸟二级 | 园豆:222
提问于:2017-11-20 15:42
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册