you can use
RegistrationCountry.setBackgroundResource(android.R.drawable.editbox_background);
To set the background to a standard background image.
The problem arises when you call any of the methods setBackgroundX(), as this will replace the current background (that is, the "outline"), so when you call setBackgroundColor(Color.RED), you replace the outline with red, and then you replace red with transparency. What you need to do is replace the red color with the original background, as you can do with the line above.
source
share