Android Acccessibility: How Do I Change The Text Read Out Loud For An Edittext View
By default, the Accessibility Services will read out the following for an EditText view If the EditText has a value entered = it will read out that value If there is not value ent
Solution 1:
We can change the text read out loud of EditText view by doing the following:
View.AccessibilityDelegateaccessibilityDelegate=newView.AccessibilityDelegate() {
@OverridepublicvoidonInitializeAccessibilityNodeInfo(View v, AccessibilityNodeInfo info) {
super.onInitializeAccessibilityNodeInfo(v, info);
info.setText("some customized text")
}
};
and then set this delegate to the EditText View.
Solution 2:
This sounds very similar to a problem I previously encountered: Android: How to eliminate spoken text from AccessibilityEvents when extending SeekBar?
Have you tried (as a test) clearing the hint text in onPopulateAccessibilityEvent
, rather than just adding the 'Apples' text? I seem to remember that my empirical results did not match the Android documentation, particularly for Android OS prior to API 14.
Post a Comment for "Android Acccessibility: How Do I Change The Text Read Out Loud For An Edittext View"