开发者

Android MotionEvent constants and methods not found

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜