Toast messages don't Talkback?

1,210 views
Skip to first unread message

Brian O'Dell

unread,
Jul 18, 2011, 5:30:37 PM7/18/11
to Eyes-free Programming and development
Hello,

I'm writing an Android app, for people with sight impairment, that
needs to tell the user that a server is unavailable. My first thought
was to use a toast pop up, but Talkback doesn't read it. After some
googling around, I can't seem to find a way to notify a user using
talkback, without firing up the TTS manually. What am I missing?

Thanks,
Brian

J.J. Meddaugh

unread,
Jul 18, 2011, 5:38:04 PM7/18/11
to eyes-f...@googlegroups.com
I'm not a programmer, but know there are apps that display messages with an
OK button which do speak messages. If you focus the message and make it
focusable using the d-pad, that may work.

Best Regards,
J.J. Meddaugh
A T Guys
Your Assistive Technology Experts
(269) 216-4798
http://www.ATGuys.com

Cheryl Simon

unread,
Jul 18, 2011, 5:38:28 PM7/18/11
to eyes-f...@googlegroups.com
Hi Brian,
TalkBack talks in response to AccessibilityEvent messages that are sent to it via the AccessibilityManager.  Thus in order to get it to talk, you need to cause an AccessibilityEvent to be emitted that it can understand.

You can see some more information on the types of accessibility events here: http://developer.android.com/guide/practices/design/accessibility.html#CustomViews or in the AccessibilityEvent javadoc: http://developer.android.com/reference/android/view/accessibility/AccessibilityEvent.html

Probably the easiest way to get it to speak a message would be to add a focusable item to the view, like a TextView with Focusable=true and set the focus to that item.  I think this should cause the TYPE_VIEW_FOCUSED event to be fired, and the contents of the TextView should be spoken.
--
Cheryl Simon | Software Engineer | cls...@google.com | 708-710-1272

Nolan Darilek

unread,
Jul 18, 2011, 6:31:24 PM7/18/11
to eyes-f...@googlegroups.com
Although, he is right, toasts don't speak. Looking through the framework code at one point, it seemed like AccessibilityEvents just weren't being raised when a notification lacked an icon. I'm not clear on the reasoning behind that design decision, but I think an issue was filed about a year or so ago. I hope it gets fixed, as toasts are a pretty common way of conveying notifications, and common things should be accessible.

Good luck.

Brian O'Dell

unread,
Jul 19, 2011, 9:35:40 AM7/19/11
to Eyes-free Programming and development
Hi Everyone, thanks for the responses.

Can I just emit the AccessibilityEvent manually, or should I "make"
the system emit the event in response to focus?

On Jul 18, 5:38 pm, Cheryl Simon <clsi...@google.com> wrote:
> Hi Brian,
> TalkBack talks in response to AccessibilityEvent messages that are sent to
> it via the AccessibilityManager.  Thus in order to get it to talk, you need
> to cause an AccessibilityEvent to be emitted that it can understand.
>
> You can see some more information on the types of accessibility events
> here:http://developer.android.com/guide/practices/design/accessibility.htm...
> or
> in the AccessibilityEvent javadoc:http://developer.android.com/reference/android/view/accessibility/Acc...
>
> Probably the easiest way to get it to speak a message would be to add a
> focusable item to the view, like a TextView with Focusable=true and set the
> focus to that item.  I think this should cause the TYPE_VIEW_FOCUSED event
> to be fired, and the contents of the TextView should be spoken.
>
> On Mon, Jul 18, 2011 at 2:30 PM, Brian O'Dell <briantod...@gmail.com> wrote:
> > Hello,
>
> > I'm writing an Android app, for people with sight impairment, that
> > needs to tell the user that a server is unavailable.  My first thought
> > was to use a toast pop up, but Talkback doesn't read it.  After some
> > googling around, I can't seem to find a way to notify a user using
> > talkback, without firing up the TTS manually.  What am I missing?
>
> > Thanks,
> > Brian
>
> --
> Cheryl Simon | Software Engineer | clsi...@google.com | 708-710-1272

Cheryl Simon

unread,
Jul 19, 2011, 12:54:31 PM7/19/11
to eyes-f...@googlegroups.com
On Tue, Jul 19, 2011 at 6:35 AM, Brian O'Dell <brian...@gmail.com> wrote:
Hi Everyone, thanks for the responses.

Can I just emit the AccessibilityEvent manually, or should I "make"
the system emit the event in response to focus?

It is possible to just send an event, but I think that is going to make less sense to the user.  If you look at the event types, they are all tied to some particular action on a widget.  If you send a TYPE_VIEW_FOCUSED event, the user will assume that they are focused on some element.  Having a real element on the screen would allow them to move around and find it again.

If there were a toast event, you are right it might make sense to do that, and then the user would be made aware that it is a transient message, but as Nolan pointed out, unfortunately that event is missing right now.



--
Cheryl Simon | Software Engineer | cls...@google.com | 708-710-1272

Dominic Mazzoni

unread,
Jul 19, 2011, 1:09:38 PM7/19/11
to eyes-f...@googlegroups.com
Hi -

Just to let you know, we've identified this bug in the Android source. We can't do anything for existing phones, but we'll make sure toasts generate accessibility events in future versions. Thanks.

- Dominic

Brian O'Dell

unread,
Jul 19, 2011, 2:36:51 PM7/19/11
to Eyes-free Programming and development
Thanks again to everyone.

I'm going to rework the app a bit so I don't need to pop up anything.

Brian

On Jul 19, 12:54 pm, Cheryl Simon <clsi...@google.com> wrote:
> Cheryl Simon | Software Engineer | clsi...@google.com | 708-710-1272

blindfold

unread,
Jul 25, 2011, 11:19:35 AM7/25/11
to Eyes-free Programming and development
Hi Dominic,

Toast is not currently a subclass of AccessibilityEventSource even in
Android 3.2. Will you be changing that? I was trying to override
future accessible Toast handling, because The vOICe for Android
already speaks its own Toast messages by encapsulating Toast message
and speech of same message, and should not get double speech once
Android adds accessibility for Toast messages. Basically I intended to
suppress (future) accessibility events from Toast messages. Now it
looks like I cannot make my app future proof.

Thanks

On Jul 19, 7:09 pm, Dominic Mazzoni <dmazz...@google.com> wrote:
> Hi -
>
> Just to let you know, we've identified this bug in the Android source. We
> can't do anything for existing phones, but we'll make sure toasts generate
> accessibility events in future versions. Thanks.
>
> - Dominic
>
> On Mon, Jul 18, 2011 at 3:31 PM, Nolan Darilek <no...@thewordnerd.info>wrote:
>
>
>
>
>
>
>
> >  Although, he is right, toasts don't speak. Looking through the framework
> > code at one point, it seemed like AccessibilityEvents just weren't being
> > raised when a notification lacked an icon. I'm not clear on the reasoning
> > behind that design decision, but I think an issue was filed about a year or
> > so ago. I hope it gets fixed, as toasts are a pretty common way of conveying
> > notifications, and common things should be accessible.
>
> > Good luck.
>
> > On 07/18/2011 04:38 PM, Cheryl Simon wrote:
>
> > Hi Brian,
> > TalkBack talks in response to AccessibilityEvent messages that are sent to
> > it via the AccessibilityManager.  Thus in order to get it to talk, you need
> > to cause an AccessibilityEvent to be emitted that it can understand.
>
> >  You can see some more information on the types of accessibility events
> > here:
> >http://developer.android.com/guide/practices/design/accessibility.htm...or
> > in the AccessibilityEvent javadoc:
> >http://developer.android.com/reference/android/view/accessibility/Acc...
>
> >  Probably the easiest way to get it to speak a message would be to add a
> > focusable item to the view, like a TextView with Focusable=true and set the
> > focus to that item.  I think this should cause the TYPE_VIEW_FOCUSED event
> > to be fired, and the contents of the TextView should be spoken.
>
> > On Mon, Jul 18, 2011 at 2:30 PM, Brian O'Dell <briantod...@gmail.com>wrote:
>
> >> Hello,
>
> >> I'm writing an Android app, for people with sight impairment, that
> >> needs to tell the user that a server is unavailable.  My first thought
> >> was to use a toast pop up, but Talkback doesn't read it.  After some
> >> googling around, I can't seem to find a way to notify a user using
> >> talkback, without firing up the TTS manually.  What am I missing?
>
> >> Thanks,
> >> Brian
>
> > --
> >  Cheryl Simon | Software Engineer | clsi...@google.com | 708-710-1272

Nolan Darilek

unread,
Jul 25, 2011, 11:32:08 AM7/25/11
to eyes-f...@googlegroups.com
It's disheartening to learn that this isn't fixed in 3.2, given that I
reported it over a year ago and was told that an issue was filed. I
can't find the message in eyes-free, but recall the context. I was
starting work on my navigation app whose first check-in was in June of
'10, and noticed right away that toasts weren't speaking. That's how I
was informed about NOTIFICATION_STATE_CHANGED not generating for
notifications without icons. As an aside, is there a way to search
Groups for messages older than a year? This isn't the first time I fail
to find threads I have specific memories of from nearly or over a year
ago, and my memory is pretty good.

This doesn't strike me as a hugely complicated issue, so I'm surprised
it wasn't resolved in 2.3 much less 3.2.

blindfold

unread,
Jul 25, 2011, 1:26:04 PM7/25/11
to Eyes-free Programming and development
Well, it could be my lack of understanding/knowledge of where the
accessibility events come from - or would come from once Toast becomes
accessible. If it suffices that I just override the TextView in my
custom toast XML that my Toast is set to via setView(), then I can eat
all accessibility events in "myTextView" and I would be fine with the
current Android versions. I am not aware of documentation that
clarifies what accessibility events get passed where as needed to know
what to override for a future proof implementation.

Thanks

On Jul 25, 5:32 pm, Nolan Darilek <no...@thewordnerd.info> wrote:
> It's disheartening to learn that this isn't fixed in 3.2, given that I
> reported it over a year ago and was told that an issue was filed. I
> can't find the message in eyes-free, but recall the context. I was
> starting work on my navigation app whose first check-in was in June of
> '10, and noticed right away that toasts weren't speaking. That's how I
> was informed about NOTIFICATION_STATE_CHANGED not generating for
> notifications without icons. As an aside, is there a way to search
> Groups for messages older than a year? This isn't the first time I fail
> to find threads I have specific memories of from nearly or over a year
> ago, and my memory is pretty good.
>
> This doesn't strike me as a hugely complicated issue, so I'm surprised
> it wasn't resolved in 2.3 much less 3.2.
>
> On 07/25/2011 10:19 AM, blindfold wrote:
>
>
>
>
>
>
>
> > Hi Dominic,
>
> >Toastis not currently a subclass of AccessibilityEventSource even in
> > Android 3.2. Will you be changing that? I was trying to override
> > future accessibleToasthandling, because The vOICe for Android
> > already speaks its ownToastmessages by encapsulatingToastmessage
> > and speech of same message, and should not get double speech once
> > Android adds accessibility forToastmessages. Basically I intended to
> > suppress (future) accessibility events fromToastmessages. Now it
> > looks like I cannot make my app future proof.
>
> > Thanks
>
> > On Jul 19, 7:09 pm, Dominic Mazzoni<dmazz...@google.com>  wrote:
> >> Hi -
>
> >> Just to let you know, we've identified this bug in the Android source. We
> >> can't do anything for existing phones, but we'll make sure toasts generate
> >> accessibility events in future versions. Thanks.
>
> >> - Dominic
>
> >> On Mon, Jul 18, 2011 at 3:31 PM, Nolan Darilek<no...@thewordnerd.info>wrote:
>
> >>>   Although, he is right, toasts don't speak. Looking through the framework
> >>> code at one point, it seemed like AccessibilityEvents just weren't being
> >>> raised when a notification lacked an icon. I'm not clear on the reasoning
> >>> behind that design decision, but I think an issue was filed about a year or
> >>> so ago. I hope it gets fixed, as toasts are a pretty common way of conveying
> >>> notifications, and common things should be accessible.
> >>> Good luck.
> >>> On 07/18/2011 04:38 PM, Cheryl Simon wrote:
> >>> Hi Brian,
> >>> TalkBack talks in response to AccessibilityEvent messages that are sent to
> >>> it via the AccessibilityManager.  Thus in order to get it to talk, you need
> >>> to cause an AccessibilityEvent to be emitted that it can understand.
> >>>   You can see some more information on the types of accessibility events
> >>> here:
> >>>http://developer.android.com/guide/practices/design/accessibility.htm...
> >>> in the AccessibilityEvent javadoc:
> >>>http://developer.android.com/reference/android/view/accessibility/Acc...
> >>>   Probably the easiest way to get it to speak a message would be to add a
> >>> focusable item to the view, like a TextView with Focusable=true and set the
> >>> focus to that item.  I think this should cause the TYPE_VIEW_FOCUSED event
> >>> to be fired, and the contents of the TextView should be spoken.
> >>> On Mon, Jul 18, 2011 at 2:30 PM, Brian O'Dell<briantod...@gmail.com>wrote:
> >>>> Hello,
> >>>> I'm writing an Android app, for people with sight impairment, that
> >>>> needs to tell the user that a server is unavailable.  My first thought
> >>>> was to use atoastpop up, but Talkback doesn't read it.  After some

David Engebretson Jr.

unread,
Jul 25, 2011, 2:11:28 PM7/25/11
to eyes-f...@googlegroups.com
Is any program "future proof"? I like the term and the concept, but even
programs that proclaim backward compatibility never seem proof from
anything.

Cheers,
David

----- Original Message -----
From: "blindfold" <seeingw...@gmail.com>
To: "Eyes-free Programming and development" <eyes-f...@googlegroups.com>

Thanks


--------------------------------------------------------------------------------


Checked by AVG - www.avg.com
Version: 8.5.449 / Virus Database: 271.1.1/3787 - Release Date: 07/25/11
06:35:00

Reply all
Reply to author
Forward
0 new messages