I have one simple app that suppose to get information from user and send an e-mail.
I have required fields, and if the user does not fill these fields they turn into red after pushing the BUTTON. I manage to change the color
The color suppose to change immediately after pressing the BUTTON, but what happens is, after clicking the button, in order the change the color(all the fields) I need to touch one of the Edit Text fields, then they change. (does not matter which one to touch, required ones or not.)
Here is my implementation for one of the fields,
if(etBayiiKodu.getText().toString().matches("")){
Log.d("BayiiKodu","NO STRING***1***");
etBayiiKodu.getBackground().setColorFilter(Color.rgb(255, 133, 145),Mode.MULTIPLY);
Log.d("BayiiKodu","NO STRING***2***");
allFilled=allFilled&&false;
}
else{
girilenSiparis.setBayiiKodu(String.valueOf(etBayiiKodu.getText()));
etBayiiKodu.getBackground().setColorFilter(Color.WHITE,Mode.MULTIPLY);
allFilled=allFilled&&true;
}
What could be reason for this?
Thank you…
Try calling .invalidate() on each view who’s color is being changed.