Search code examples
androiduser-interfaceserviceandroid-activityonfling

Simulate onFling() programmatically instead of detecting it (Android)


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.

Thanks beforehand!


Solution

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