Is Accessibility enabled for Android WebView? Can anyone tell how to make a WebView accessible?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
You can extend the WebView class to implement Accessibility API methods.
http://developer.android.com/guide/topics/ui/accessibility/apps.html#custom-views
I also ran into this issue on 4.0 devices. I ended up placing a TextView on top of the WebView, making the TextView background and text transparent. The text content of the TextView being set to the content of WebView with all HTML tags stripped out.
A most inelegant solution, I know, but hey it works....
The Android webview accessibility is enabled via javascript injection in Honeycomb and above (as pointed out by alanv). The user must enable it by:
This works by injecting javascript into each loaded pages via
<script>
tags. Note that you will have to be careful, as not all content will play nice with this javascript, and the injection will fail in some edge cases.I know how to access web view content by Accessibility API, when AccessibilityNodeInfo.getText() is null or "null", call AccessibilityNodeInfo.getContentDescription().
simple code:
getContentDescription() can get the web view content.
sorry for my poor english.
No, the
WebView
is not accessible from the built-in TalkBack service, at least as of Android version 4.0. Instead, blind users are instructed to use something like Mobile Accessibility for Android, which provides a spoken browsing interface. I would suggest making your content available to other processes, allowing blind users to view the content in their browser of choice. I did this by starting an intent to view the content:Alternatively, you can set the content description of the WebView. Note that this only seems to work in pre 4.0 versions of android. I've found that 4.0 devices keep either say WebView or nothing at all.