Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen using TalkBack, what is the preferred way to alert the user when the contents of a TextView have changed?
    primarykey
    data
    text
    <p>I have an unlock screen where the user is prompted to enter a four digit pin. If the user enters their pin incorrectly, a previously invisible <code>TextView</code> is shown with an error message. At this point it would be useful for TalkBack to read the contents of the error message out loud.</p> <p>Through some experimentation, I realized I could set <code>android:focusableInTouchMode="true"</code> on the view and programmatically call <a href="http://developer.android.com/reference/android/view/View.html#requestFocus%28%29"><code>View#requestFocus()</code></a>. This works the first time, but fails on subsequent errors since the view already has focus. Also it seems like a bad idea in general to override the current view focus.</p> <p>I then tried invoking <a href="http://developer.android.com/reference/android/view/View.html#announceForAccessibility%28java.lang.CharSequence%29"><code>View#announceForAccessibility(java.lang.CharSequence)</code></a> when the error message is displayed. Apparently this method will <em>silently fail</em> if the view is not currently visible. No problem and otherwise it works perfectly. However, it's only available in API level 16+ (Jelly Bean) which really limits it's usefulness. There has to be a better solution since TalkBack supports API level 7+.</p> <p>I've watched both the 2011 and 2012 Google I/O sessions on accessibility, but neither seem to cover this basic use case. What's the best way to do this?</p> <p><strong>Edit 1:</strong> TLDR; Is there a way to <em>force</em> TalkBack to read some text out loud prior to the introduction of <code>View#announceForAccessibility(java.lang.CharSequence)</code> in Jelly Bean?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload