Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid List View duplicates Edit Text values on scrolling
    text
    copied!<p>I have a <code>listview</code> with one <code>textview</code> and a <code>edit text</code> in each row. If i am setting a value in one edit text field and then on scrolling down, i am getting a duplicate value of that entered field value in some other edit text field. How can i resolve this issue? </p> <p>My adapter class is as shown below:</p> <pre><code>public class CustomAdapter extends ArrayAdapter&lt;String&gt; { private Context context; private String[] names; ViewHolder holder; static class ViewHolder { public TextView text; public EditText editText; } public CustomAdapter(Context context, int textViewResourceId, String[] names) { super(context, textViewResourceId, names); this.context = context; this.names = names; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.row_design, parent, false); holder = new ViewHolder(); holder.text = (TextView) convertView.findViewById(R.id.textView1); holder.editText = (EditText) convertView.findViewById(R.id.editText1); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } String s = names[position]; holder.text.setText(s); return convertView; } } </code></pre> <p>I have referred this links: <a href="https://stackoverflow.com/questions/9243888/listview-duplicate-action?rq=1">Listview duplicate action</a>, <a href="https://stackoverflow.com/questions/8398529/android-listview-duplicates-the-item-on-scroll?rq=1">Android listview duplicates the item on scroll</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload