Creating a static drawing on a
Canvas is all well and good, but let's take this a bit further and explore how we can make an application that allows the user to create a drawing.
To start this application, we'll need to understand how Android tells us when a user has touched the touchscreen. Being able to handle that, we can then allow the user create a drawing using his or her fingers on the touchscreen.
As we know, many of the UI elements that we use in Android derive from the
View class. Since we have been working with the
Canvas from a
Bitmap that is displayed in an
ImageView, it makes sense to see if that can help us out with detecting where the user touches.
As luck would have it, the
View class is touch-capable. ...