I want to update in and ArrayAdapter
a TextView
when user will click +
or -
button. I cannot figure out how can I change data of individual in ArrayApapter
.
Here is a image for better explanation what I want to do :
public View getView(int position, View countView, ViewGroup parent) {
View listView = countView;
if (listView == null) {
listView = LayoutInflater.from(getContext()).inflate(R.layout.listview, parent, false);
}
word currentWord = getItem(position);
TextView foodName = (TextView) listView.findViewById(R.id.food);
Button minus = (Button) listView.findViewById(R.id.minus);
Button add = (Button) listView.findViewById(R.id.add);
TextView total = (TextView) listView.findViewById(R.id.total);
add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
minus.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
return listView;
}