Android - verhindert, dass TalkBack den TextView-Titel laut ansagt

Ich entwickle eine barrierefreie Android-Anwendung, bei der Benutzer die Dienste Explore by Touch und TalkBack für die Barrierefreiheit verwenden, um meine Anwendung zu verwenden.

Dies ist mein Android XML-Code:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/LinearLayout" 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:id="@+id/forename"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="20dip"
        android:layout_marginLeft="15dip"
        android:textSize="20sp"
        android:text="@string/forenameText" 
        android:contentDescription="@null"/>

    <EditText
        android:id="@+id/EditTextForename"
        android:layout_width="285dp"
        android:layout_height="65dp"
        android:layout_marginTop="10dip"
        android:layout_marginLeft="15dip"
        android:hint="@string/forenameHint"
        android:inputType="textPersonName"
        android:lines="1"
        android:singleLine="true"
        android:textSize="20sp" >
    </EditText>

</LinearLayout>

strings.xml

<string name="forenameText">Forename</string>
<string name="forenameHint">Enter your forename here</string>

TextView zeigt den Titel "Forename" an und EditText ermöglicht mir, einige Details in das Formularfeld einzugeben. Das Problem ist, dass TalkBack, wenn ich mit Explore by Touch meinen Finger über den Bildschirm ziehe, den Titel der TextView aufnimmt und ihn laut als "Forename" ansagt. Ich möchte, dass das TextView nur Text anzeigt und kein hörbares Feedback gibt.

Ich habe contentDescription auf @null gesetzt, wie Sie aus dem obigen Code ersehen können, aber TalkBack kündigt weiterhin "Forename" an, wenn sich mein Finger über der Textansicht befindet.

Ich habe auch versucht, contentDescription in meiner Java-Klasse einzustellen:

TextView forename=(TextView)findViewById(R.id.forename);
forename.setContentDescription("");

Ich habe jedoch immer noch das gleiche Problem. Gibt es eine andere Möglichkeit, contentDescription auf null / empty zu setzen und zu verhindern, dass TalkBack es laut ansagt?

Java-Code:

public class MainActivity extends Activity{

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        View forename = findViewById(R.id.forename);

        forename.setAccessibilityDelegate(new AccessibilityDelegate() {
          public boolean performAccessibilityAction (View host, int action, Bundle args){
            return true;
          }
        });
    }

}

Antworten auf die Frage(6)

Ihre Antwort auf die Frage