简体   繁体   English

Android KitKat 4.4 TalkBack视图刷新问题

[英]Android KitKat 4.4 TalkBack view refresh issue

I'm running my app on an Android 4.4.2 (KitKat) device. 我在Android 4.4.2(KitKat)设备上运行我的应用程序。 My app has a ListView. 我的应用程序有一个ListView。 When I add the last item to the list view, it shows some content, and about 5 seconds later, it changes (loads a different view to that specific list item). 当我将最后一项添加到列表视图时,它显示了一些内容,大约5秒钟后,它发生了变化(将另一个视图加载到该特定列表项)。

While TalkBack is on - 启用“话语提示”时-

If, in that 5 seconds window, I click on the last item - the TalkBack marks it, reads it, and does not let the view change. 如果在这5秒钟的窗口中,我单击了最后一项-“话语提示”会对其进行标记,读取并不会改变视图。

I do not have this issue on previous Android version. 我在以前的Android版本上没有这个问题。

Anyone knows why this happens? 有人知道为什么会这样吗? and if I can override this behavior? 如果我可以覆盖此行为?

Thanks! 谢谢!

PB PB

I did not find a direct solution. 我没有找到直接的解决方案。 I have solved the issue by overriding accessibility default behavior. 我已经通过覆盖可访问性默认行为解决了该问题。 I removed the mark around the view and kept only the reading part. 我删除了视图周围的标记,只保留了阅读部分。

This is the code I used: 这是我使用的代码:

view.setAccessibilityDelegate(new AccessibilityDelegate() {
            @Override
            public boolean performAccessibilityAction(View host, int action, Bundle args) {
                //call super to perform the action
                boolean ret = super.performAccessibilityAction(host, action, args);
                //call super with remove-focus action to remove the mark around the view
                super.performAccessibilityAction(host, AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS, args);
                return ret;
            }
         });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM