Search code examples
androidandroid-listviewrefreshandroid-4.4-kitkattalkback

Android KitKat 4.4 TalkBack view refresh issue


I'm running my app on an Android 4.4.2 (KitKat) device. My app has a 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).

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.

I do not have this issue on previous Android version.

Anyone knows why this happens? and if I can override this behavior?

Thanks!

PB


Solution

  • 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;
                }
             });