TextInputLayout has no effect for giving hint programmatically in EditText

You have to set hint to TextInputLayout
Here is the code.

TextInputLayout textInputLayout = (TextInputLayout)findViewById(R.id.text_input_layout);
textInputLayout.setHint("Hello");

Updated

In Kotlin:

val textInputLayout = findViewById(R.id.text_input_layout)
textInputLayout.hint = "Hello"

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)