如何使用Android UI Automator双击

如何使用Android UI Automator双击,android,android-uiautomator,Android,Android Uiautomator,我正在尝试使用Android UI Automator工具双击一个视图,但是没有API可以双击。是否有其他方法可以使用ui automator双击 提前谢谢。您想双击什么?哪种元素?你好,斯姆瑞蒂,谢谢你的评论。我想双击图像视图,但ui自动机并没有直接的api。但最后我找到了解决办法。我使用Configurator()apuiobject selectImage=new UiObject(new UiSelector().className(“android.widget.RelativeLay

我正在尝试使用Android UI Automator工具双击一个视图,但是没有API可以双击。是否有其他方法可以使用ui automator双击


提前谢谢。

您想双击什么?哪种元素?你好,斯姆瑞蒂,谢谢你的评论。我想双击图像视图,但ui自动机并没有直接的api。但最后我找到了解决办法。我使用Configurator()apuiobject selectImage=new UiObject(new UiSelector().className(“android.widget.RelativeLayout”).index(3))配置了事件之间的延迟;Configurator cc=Configurator.getInstance();cc.setActionAcknowledgementTimeout(40);选择Image。单击();选择Image。单击();@SatyaAttili建议使用
SetActionAcknowledgementTimeout(40)
的方法对我很有效。添加
SetActionAcknowledgementTimeout(40)
似乎还有助于融合除
UiObject.click()之外的其他操作组合。例如,我需要在涉及
UiObject的地图上自动执行放大操作。单击()
,后跟
UiObject.swipeDown(30)
(也要缩小
UiObject.click()
,后跟
UiObject.swipeUp(30)
。如果不添加
setActionAcknowledgementTimeout(40)
,它就无法工作。