开发者

How to simulate touch events and send them to foreground activity (On device)

开发者 https://www.devze.com 2023-01-30 06:41 出处:网络
I wish to be able to send touch events to the foreground Activity. Assume that I don\'t have control over the foreground Activity. For example sending touch events to Android Gallery Activity or even

I wish to be able to send touch events to the foreground Activity. Assume that I don't have control over the foreground Activity. For example sending touch events to Android Gallery Activity or even the Main Menu.

I've read that there are ways to perform this task under TouchUtils - using ActivityInstrumentationTestCase2, which a more of an automated testing tool.. I'm willing to go down this road as long that I can launc开发者_开发技巧h the OEM Activities that arrives with the device and send them the simulated touch events.

Is there a way to do so? Is there anything in MotionEvent that could help? (other then creating the actual touch event)

Thanks for helping,

Ita

0

精彩评论

暂无评论...
验证码 换一张
取 消