模拟,而不是检测它onFling()编程(安卓)而不是、onFling

2023-09-12 06:06:08 作者:有范儿的女人

这是我对计算器的第一篇文章!我有一个后台服务运行,我在想,如果我能真正模拟水平一扔触摸屏手势,而不是只检测到它被调用。

This is my first post on StackOverflow! I have a background service running and I was wondering if I could actually simulate a horizontal fling touch screen gesture instead of just detecting that it was been called.

我可以计算出如何捕捉到这一事件,但我想实际模拟,而不是等待一个触摸一扔水平的姿态。

I can figure out how to capture this event, but I want to actually simulate a touch fling horizontal gesture instead of waiting for one.

由于事先!

推荐答案

有一个的 API 模拟触摸事件。 有人报告有限的成功模拟使用一扔该TouchUtil API。

There is an API for simulating touch events. Some people report limited success simulating a fling using the TouchUtil API.

 
精彩推荐
图片推荐