What I'm trying to do is, When i click on the application screen I want to get how many Fingers tap on the screen ? Means 1 finger tap, 2 finger tap and three finger tap.
Asked
Active
Viewed 172 times
0
-
Check this: https://stackoverflow.com/a/7840953/7746134 – Saurabh Thorat Nov 21 '19 at 07:12
-
https://stackoverflow.com/questions/4268426/android-difference-between-action-up-and-action-pointer-up/4269592#4269592 – Ankita Nov 21 '19 at 07:16
1 Answers
0
Use MotionEvent.getPointerCount()
. You can read more details here: Respond to touch events
public boolean onTouchEvent(MotionEvent event) {
int action = event.getAction();
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_POINTER_DOWN:
int count = event.getPointerCount();
// TODO: Do something you want here
break;
}
}

iForests
- 6,757
- 10
- 42
- 75