1

Pretty much I have an application where you press a button and it adds 2 separate editTexts to the current layout but I am stuck with using a dark background as the default theme has a white underline. I cannot change the color of the editTexts and am stuck with a theme color I don't want.

user3042332
  • 81
  • 1
  • 7

1 Answers1

0

I suppose you're creating your EditTexts dynamically (as you said in your question).

You just have to mutate the background of your newly created EditText. This can be achieved as follows:

yourEditText.getBackground()
            .mutate()
            .setColorFilter(getColor(R.color.someColor), PorterDuff.Mode.SRC_ATOP);

Related question

Changing EditText bottom line color with appcompat v7

Community
  • 1
  • 1