When using EditText in combination with Design lib\'s (ver 22.2.1) TextInputLayout getting hint programmatically returns null.
I\'m trying to append asterisk \'*\'
Actually the hint moves to the parent view TextInputLayout
that surrounds the EditText
view:
You can get the hint like this:
android.support.design.widget.TextInputLayout parent = (android.support.design.widget.TextInputLayout) yourEditText.getParent();
String hint = parent.getHint().toString();
And if you want to add *
make it like this:
parent.setHint(parent.getHint() + "*");
Happy codding! :)