6.3.4. Overriding View Method onTouchEvent

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset