
Question:
I searching about method which I check which way I touch screen and after that send information to touch event. I want to check if I touch screen one finger or two fingers or I move finger on screen. This is any method to check what I am doing my fingers on the screen befor application do some actions?
Answer1:I think you can try this one.
A drag gesture starts when the first finger is pressed to the screen (<strong>ACTION_DOWN</strong>) and ends when it is removed (<strong>ACTION_UP</strong> or <strong>ACTION_POINTER_UP</strong>).
switch (event.getAction() & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_DOWN:
savedMatrix.set(matrix);
start.set(event.getX(), event.getY());
Log.d(TAG, "mode=DRAG" );
mode = DRAG;
break;
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_POINTER_UP:
mode = NONE;
Log.d(TAG, "mode=NONE" );
break;
case MotionEvent.ACTION_MOVE:
if (mode == DRAG) {
matrix.set(savedMatrix);
matrix.postTranslate(event.getX() - start.x, event.getY() - start.y);
}
break;
}
for complete information check <a href="http://www.zdnet.com/blog/burnette/how-to-use-multi-touch-in-android-2-part-5-implementing-the-drag-gesture/1789" rel="nofollow">here</a>
(or)
for document check <a href="http://developer.android.com/guide/topics/ui/drag-drop.html" rel="nofollow">here</a>