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 \'*\'
This is fixed in design support 23.0.0 but the project has to be compiled for api 23.
build.gradle
android {
compileSdkVersion 23
buildToolsVersion '23'
....
}
dependencies{
compile 'com.android.support:appcompat-v7:23.0.0'
...
}
Setting the hint on the EditText like before:
Now adding an extra character to the hint:
TextInputLayout inputField = (TextInputLayout) findViewById(R.id.inputLayout);
String hint = String.format("%s *", inputField.getHint());
inputField.setHint(hint);