Android canvas detect touch points
To detect the touch events on the canvas of a View class we can use the boolean method onTouchEvent(MotionEvent). In the View created in example below, it draws a line from previous touch point to new touch point. Add the View in activity_main.xml In MainActivity.java put following codes. Output