how to get webview from AccessibilityNodeInfo

好久不见. 提交于 2019-12-06 11:11:34

No, because the WebView is in another process, not yours.

There is not a way to access all of the properties of the WebView, as a WebView. AccessibilityNodeInfo objects are completely separate from the objects that they represent.

However, since you are in control of the application, you could easily provide this information in the content description of one of the elements of your application, which would then easily be accessed by your Accessibility Service. Just be sure not to break the general accessibility of your application, when using this somewhat hackish solution.

Note: I would question the design decisions that lead you to this line of thinking. Perhaps a more general description of what you're trying to do, would allow us (the Stack Overflow community) to suggest a better way of accomplishing similar things.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!