Search code examples
androidaccessibilitytalkback

Android WebView accessibility in KitKat


I'm having some trouble getting TalkBack to work with a web view (testing with a Nexus 5 on Android 4.4.2). I read that TalkBack support was added to web views around the release of Android JellyBean by checking a preference titled "Enhance Web Accessibility." I can't for the life of me find this preference in the system settings.

Focusing on the web view in our application simply reads "WebView" and provides no other options. I've made sure and called getSettings().setJavaScriptEnabled(true); on the web view.

Was TalkBack support for web views removed in KitKat? If not, what am I missing here?


Solution

  • On 4.4, you need to have TalkBack/Explore by Touch enabled on the first run of your application. If you enabled it after that, it never seems to work. I figured this out by trial and error. I suspect scripts are being injected into your app/WebView on first launch to support it.

    As an alternative, you could manually inject the ChromeVox scripts into your WebView and enable accessibility that way. Check out how the PhoneGap plugin does it - https://github.com/phonegap/phonegap-mobile-accessibility