android - The difference of using MotionEvent.getAction() method -
what difference between 2 approaches below?
int action1 = event.getaction() & motionevent.action_mask; int action2 = event.getaction();
the action_mask
used separate actual action , pointer identifier (e.g. first finger touched, second finger touched, etc.) first 8 bits of value returned in getaction() actual action part, , when bitwise-and action mask (= 11111111 = 255 = 0xff), left action , none of pointer information.
keep in mind here &
used arithmetic operator (bitwise) , not logical operator (single &
valid logical operator in java, &&
).`
Comments
Post a Comment