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
精彩评论