Skip to main content
stolennickname
Inspiring
Dec 19, 2014 12:25 PM UTC
Question

TouchEvent touchPointID is always 0 on Android

With AIR 16.0.0.245 app running on Android devices, I'm having a problem getting meaningful touchPointID values for single taps. The value is always reported as 0. This makes it impossible for me to track if a given TouchEvent is actually the same TouchEvent occurring in a different phase.

When I run the same code on iOS, subsequent touches increase their ID with each tap, which is as expected. I am getting the exact same positive results on both platforms from Multitouch.supportedGestures, Multitouch.supportsGestureEvents, and Multitouch.supportsTouchEvents. Multitouch.inputMode also reports touchPoint.

This is crippling my project right now.

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

stolennickname
Inspiring
Dec 19, 2014 1:13 PM UTC

I've tried setting and removing the following manifest settings, to no avail:

<uses-feature android:name="android.hardware.touchscreen" android:required="true" />
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="true" />

<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="true" />

Translate
Participating Frequently
Jan 9, 2015 8:25 PM UTC

Just count the number of TOUCH_BEGIN events with touchPointID of 0 to determine if it's a new touch or not. The touchPointID starts at 0 (whereas iOS starts at 1), but a second finger will report 1, then 3rd finger 2, etc.

Translate