What I want to do is to draw a line that will follow my finger. I\'ve created
a custom view, and I have an onTouchEvent() that works.
I can draw a sta
A touch event is associated with a list of pointer counts retrievable like the following:
int p = event.getPointerCount();
iterating over these and drawing points can cause a continuous line to appear
if (event.getAction() == MotionEvent.ACTION_MOVE
|| event.getAction() == MotionEvent.ACTION_DOWN) {
int p = event.getPointerCount();
for (int i = 0; i < p; i++) {
c.drawPoint(event.getX(i), event.getY(i), paint);
}
}
Assuming paint is already set and c is the canvas, which may need to be locked (Eg- in a multithread application), prior to drawing on it.