Code example for MotionEvent.PointerCoords

0
	 * @param canvas to write on. 
	 */ 
	private void startTouch(MotionEvent event, Canvas canvas)
	{ 
		canvas.drawPoint(event.getX(), event.getY(), paint);
		this.previous = new PointerCoords();
		this.previous.x = event.getX();
		this.previous.y = event.getY();
	} 
 
	/** 
	 * Draw a line from previous point to here. 
	 * @param event specifies the coordinates. 
	 * @param canvas to write on. 
	 */ 
	private void continueTouch(MotionEvent event, Canvas canvas)
	{ 
		if (this.previous == null)
		{ 
			Log.e(LOG_TAG, "Could not continue touch");
Contextual code suggestions in your IDE  Get Codota for Java