Search code examples
androidcolorsandroid-edittexthint

Can I get the default hint color of an EditText?


Is there a way to get the hint color from an EditText?

I need the color to set it as the text color of the EditText too


Solution

  • I guess you could use this:

    final ColorStateList colors = editText.getHintTextColors();
    editText.setTextColor(colors);
    

    Note that hint color is actually a ColorStateList.