Users interact with this app by touching the device’s screen. A touch aligns the cannon to face the touch point on the screen, then fires the cannon. To process simple touch events for the CannonView
, you’ll override View
method onTouchEvent (Section 6.8.13), then use constants from class MotionEvent (package android.view
) to test which type of event occurred and process it accordingly.