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"