We're looking to send an accessibility event (which would be picked up by TalkBack etc.) which isn't linked to a view.
For example, how could I send an accessibility event (e.g. talkback saying "Data downloaded") when a AsyncTask has finished?
We're looking to send an accessibility event (which would be picked up by TalkBack etc.) which isn't linked to a view.
For example, how could I send an accessibility event (e.g. talkback saying "Data downloaded") when a AsyncTask has finished?
Try use a Broadcast message, you can send a Intent to Broadcast Receiver, then in the Receiver you can launch a notification or something.
It looks like the current version of TalkBack ignores announcements if AccessibilityEvent.getSource() returns null, so you're best off using a Toast. This had the added benefit of providing consistent feedback to users whether or not they are using TalkBack.
Normally, though, you could manually create an AccessibilityEvent and send it through the AccessibilityManager.
You can use the accessibility manager directly (since API 14) like @alanv said. But since API 16, you must provide a view.