Good evening stackoverflow
This time I'm fighting a ListView containing text items.
I am adding an OnItemClick listener.
v.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
TextView tvItm = (TextView) arg1;
int Col = tvItm.getTextColors().getDefaultColor();
if (Col == Color.WHITE)
tvItm.setTextColor(Color.GREEN);
else
tvItm.setTextColor(Color.WHITE);
}
});
As you can see, I switch the text color and it works. BUT, it works on several items at a time, although I only click one item. So when I click on the first element, it turns green, then six white elements, and the 7th element turns green, but I never pressed the 7th element.
item1 - -
item2 - -
item3 - -
item4 - -
item5 - -
item6 - -
item7 - -
item8 - -
item9 - -
....
.
, , 1 2 .
:

:
: "AK Kusine"
. , " " .
Listener, .
? , ?