I have this layout:
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:textColorHint="@android:color/white">
<EditText android:id="@+id/input_name"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="textCapWords"
android:hint="Name" />
</android.support.design.widget.TextInputLayout>
And I want to change the Hint Text form Java when a switch button is touched, but this is what happens using this code:
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked)
{
if (isTouched) {
isTouched = false;
if (isChecked) {
_nameText.setHint("Shop Name");
_inputPiva.setHint("ho la cacca");
}
else {
_nameText.setHint("Name");
}
}
}
How can I set the hint like the light-blue one?