Android 如何滚动accessibilitynodeinfo?

Android 如何滚动accessibilitynodeinfo?,android,scroll,accessibilityservice,Android,Scroll,Accessibilityservice,我正在使用AccessibilityService API为第三方应用程序构建一个Accessibility服务。但我不知道如何向后滚动accessibilitynodeinfo?你们能帮帮我吗? node.perform(AccessibilityNodeInfo.ACTION\u SCROLL\u BACKSCROLL)不起作用。我相信这就是您想要的: void scrollBackward(AccessibilityNodeInfo) throws NotScrollable {

我正在使用AccessibilityService API为第三方应用程序构建一个Accessibility服务。但我不知道如何向后滚动accessibilitynodeinfo?你们能帮帮我吗?
node.perform(AccessibilityNodeInfo.ACTION\u SCROLL\u BACKSCROLL)不起作用。

我相信这就是您想要的:

void scrollBackward(AccessibilityNodeInfo) throws NotScrollable {

    while (node != null) {

        if (node.isScrollable()) {
            node.performAction(ACTION_SCROLL_BACKWARD);
            return;
        }

        node = node.getParent();

    }

    throw new NotScrollable("This node cannot be scrolled");
} 

注意:我正在打电话,所以请原谅我,如果这不是很好的编译。应该很近。

我相信这就是你想要的:

void scrollBackward(AccessibilityNodeInfo) throws NotScrollable {

    while (node != null) {

        if (node.isScrollable()) {
            node.performAction(ACTION_SCROLL_BACKWARD);
            return;
        }

        node = node.getParent();

    }

    throw new NotScrollable("This node cannot be scrolled");
} 
注意:我正在打电话,所以请原谅我,如果这不是很好的编译。应该很近