0

I'm using Accessibility to read the content in ViewPager, in the first page, everything is alright, Accessibility is reading the content of current page, But when I turn to next page, Accessibility still reading the the content of previous page.

For example:

Page1 -> TextView -> content1

Page2 -> TextView -> content2

Page3 -> TextView -> content3

Accessibility reads content1 when current page is Page1, then turn to Page2, Accessibility reads content1,Accessibility reads content2, this is so werid reading code is like this:

 List<AccessibilityNodeInfo> nodeInfoList = accessibilityNodeInfo.findAccessibilityNodeInfosByViewId(id);
    if (nodeInfoList != null && !nodeInfoList.isEmpty()) {
        for (AccessibilityNodeInfo nodeInfo : nodeInfoList) {
            if (nodeInfo != null) {
                return nodeInfo.text;
            }
        }
    }

Any body help me?

lucher
  • 1

0 Answers0