开发者

Android MotionEvent constants and methods not found

开发者 https://www.devze.com 2023-03-15 08:53 出处:网络
I\'m reading the book \"Beginning Android Games\" and the code won\'t compile. All of these constants are not found in the MotionEven开发者_如何学运维t class:

I'm reading the book "Beginning Android Games" and the code won't compile.

All of these constants are not found in the MotionEven开发者_如何学运维t class:

MotionEvent.ACTION_MASK
MotionEvent.ACTION_POINTER_DOWN
MotionEvent.ACTION_POINTER_UP

And these methods:

event.getX(pointerIndex)
event.getPointerCount()
event.getX(pointerIndex)


Which API level do you use for your android project ?

It should be at least 2.0 (level 5). For every android method or constant, look at the docs. On the gray banner for the name of this field, on the right, there is a version number that indicates the level of Android API that introduced this feature.

Regards, Stéphane

0

精彩评论

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