Это мой код:
XML
Код: Выделить всё
...
...
Код: Выделить всё
View linea2 = (View)findViewById(R.id.viewPlanos2);
linea2.setBackgroundColor(getResources().getColor(R.drawable.linea_verde));
Код: Выделить всё
РЕДАКТИРОВАТЬ:
Я пробовал:
Код: Выделить всё
public void onClick(View v) {
if(v == botonMetro) {
linea2.setBackgroundResource(R.drawable.linea_verde);
and
linea2.setBackgroundColor(getResources().getColor(R.drawable.linea_verde));
}
}