This is a known bug in the accessibility framework. Other than adding null checks, there doesn't seem to be a good work around. https://code.google.com/p/android/issues/detail?id=58733#c4
On Wednesday, December 17, 2014 at 9:53:30 PM UTC-5, Eric Millin wrote: > > I'm seeing intermittent behavior where UiAutomator returns null for an > element that is visible. This happens about 25% of the time when searching > by description or text on an emulator running API 19. I'm using the > 4.4.2r3 android jar. > > QueryController(2291): AccessibilityNodeInfo returned a null child (1 of 2) >> QueryController(2291): parent = >> android.view.accessibility.AccessibilityNodeInfo@1a455; boundsInParent: >> Rect(0, 0 - 480, 57); boundsInScreen: Rect(0, 648 - 480, 705); packageName: >> my.launcher; className: android.widget.LinearLayout; text: null; >> contentDescription: null; viewIdResName: my.launcher:id/bottom_btns; >> checkable: false; checked: false; focusable: false; focused: false; >> selected: false; clickable: false; longClickable: false; enabled: true; >> password: false; scrollable: false; [ACTION_SELECT, ACTION_CLEAR_SELECTION, >> ACTION_ACCESSIBILITY_FOCUS] >> > > Once it occurs the element remains undiscoverable regardless of how many > times the search executes. The element is also missing from UI xml dumps. > I tried refreshing the AccessibilityNodeInfo object but that doesn't help. > The element does not have an accessibility ID. My understanding is the > element has visibility set to View.GONE when it is created, but then > changes to visible. > > I've confirmed this behavior with other developers, so I'm confident it's > not localized to my machine (or my chair ;) ). Any help would be greatly > appreciated. > > -- You received this message because you are subscribed to the Google Groups "adt-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
