我有带有 edittext 和-/+按钮的列表视图。当我单击按钮更改 edittext 值时,例如increment/decrement。
当我将值设置为5并滚动列表视图时,edittext 将值设置为默认值,例如 0。
我正在使用这种方式
public View getView(final int position, View convertView,ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View connection;
final ViewHolder holder;
connection = new View(context);
connection = inflater.inflate(R.layout.list_row_modified, null);
holder = new ViewHolder();
holder.up = (Button) connection.findViewById(R.id.btn_plus);
holder.down = (Button) connection.findViewById(R.id.btn_minus);
holder.date = (TextView) connection.findViewById(R.id.text_date);
//onClick with holder.up/holder.down
connection.setTag(holder);
return connection;
}