I am working on a large project, where we use TextView
s to show text as well as a hint.
When using talkback (accessibility), I have noticed that the hint on a TextView
is read twice.
Also even when there is text in the TextView
, the hint will still be read.
When I use an EditText
instead, only the second problem persists (text entered, hint is still read). This seems to be normal (but confusing) Android-behaviour, since Google-Apps like the PlayStore do this as well.
But why is the TextView
reading the hint twice, while an EditText
is not?
PS: I am aware of the possibility to switch from TextView
to EditText
, but since we are using custom views as well that heavily depend on TextView
, this is not a feasible option.
I am also aware of using label for
, but I am more interested in the technical background why TextView
reads the hint twice.
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="test"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>