在我的应用程序中,我使用带有文本视图、编辑文本和按钮的自定义列表视图。当我单击“0”位置的按钮并更改“0”位置的文本视图值时。当我向下滚动列表时-查看“0”位置文本视图中的值更改为初始状态。
我的基本适配器类
public class sample extends BaseAdapter{
public ArrayList<HashMap<String, String>> list;
Activity activity;
public sample(Activity activity,ArrayList<HashMap<String, String>> list) {
    super();
    this.activity = activity;
    this.list = list;
}
public int getCount() {
    // TODO Auto-generated method stub
    return list.size();
}
public Object getItem(int position) {
    // TODO Auto-generated method stub
    return list.get(position);
}
public long getItemId(int position) {
    // TODO Auto-generated method stub
    return 0;
}
class ViewHolder {
    Button order;
    TextView item_name, order_qty;
    EditText et_quantity;
}
public View getView(final int position, View convertView,final ViewGroup parent) {
    // TODO Auto-generated method stub
    final ViewHolder holder;
    LayoutInflater inflater = activity.getLayoutInflater();
    if (convertView == null) {
        convertView = inflater.inflate(R.layout.order_custom, null);
        holder = new ViewHolder();
        holder.order = (Button) convertView.findViewById(R.id.order);
        holder.item_name = (TextView) convertView.findViewById(R.id.item_name);
        holder.order_qty = (TextView) convertView.findViewById(R.id.order_count);
        convertView.setTag(holder);
    } else {
        holder = (ViewHolder) convertView.getTag();
    }
try{
    HashMap<String, String> map = list.get(position);
    holder.item_name.setText(map.get("name"));
    //Log.v("Available or not", ""+map.get("available"));
}catch(Exception e){
    e.printStackTrace();
}
holder.order.setOnClickListener(new View.OnClickListener() {
    public void onClick(View arg0) {
        // TODO Auto-generated method stub
        //here am click the button to change order count text value
        int qty = Integer.valueOf(""+holder.order_qty.getText().toString());
        qty++;
        holder.order_qty.setText(""+String.valueOf(qty));
 }
});
return convertView;
}
}
我不知道为什么向下滚动自定义列表视图时文本值会更改为初始状态。有人知道请帮我解决这个问题