I have an edit text which I validate. If the data entered does not corespond to the format, I set the background to red, when it coresponds I set it back to light gray, but the rectangle disappears. I was wondering if I could reset it's properties to their orignal values when the data entered has the correct format. This is what i am doing now
EditText name = (EditText) findViewById(R.id.Name);
if (name.getText().length() < 1)
{
error = true;
unit.setBackgroundColor(Color.RED);
}
else
{
//instead of this line reset edittext properties
unit.setBackgroundColor(Color.LTGRAY);
}