How to filter MotionEvent.getAction () at API level 3 (without the presence of ACTION_MASK)

Im writing OnTouchListener. I found out that I can check ActionType with bit operations like

if ((event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_MOVE)

however MotionEvent.ACTION_MASKmissing from Android 1.5 (API level 3) How was / was done there?

+5
source share
1 answer

ACTION_MASK (, , ..) 8 , getAction() - , , - ( = 11111111 = 255 = 0xff), .

Android 1.5/API 3 MotionEvent (.. multitouch). . , :

if ((event.getAction() == MotionEvent.ACTION_MOVE) {...}

, , 255 - , API.

docs MotionEvent ( Android) API. API 3, . , , .

+4

All Articles