Android - prevent TalkBack from announcing TextView title aloud Android - prevent TalkBack from announcing TextView title aloud android android

Android - prevent TalkBack from announcing TextView title aloud


Since API 16, Android introduced the following:

android:importantForAccessibility="no"

or

setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO)

Which allows developers to disable talkback all together for certain views.

http://developer.android.com/reference/android/view/View.html


For better backwards compatibility:

ViewCompat.setImportantForAccessibility(        decorativeTextView,        ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO);


I was trying to do the same today, and was able to set an 'empty' contentDescription on a TextView like so (using a non-breaking whitespace):

decorativeTextView.setContentDescription("\u00A0"); 

now TalkBack doesn't say anything for that TextView.

but I agree with Nick about leaving the label as readable in your case, because hint is only read for empty EditTexts.