I have the following java code:
message.setTag("_message");
where is run multiple times with different message assigned to it.
When I
message.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
View message = layout.findViewWithTag("_message");
switch (motionEvent.getAction()) {
case MotionEvent.ACTION_DOWN:
message.setBackgroundColor(Color.YELLOW);
break;
case MotionEvent.ACTION_UP:
message.setBackgroundColor(0x00000000);
break;
}
return false;
}
});
Only the first message gets highlight. How can I make all of the messages highlight?