7.10. Wrap-Up
In this chapter, you built the Doodlz app which enables users to paint by dragging one or more fingers across the screen. You implemented a shake-to-erase feature by using Android’s SensorManager
to register a SensorEventListener
that responds to accelerometer events, and you learned that Android supports many other sensors.
You created subclasses of DialogFragment
that displayed custom View
s in AlertDialog
s. You also overrode the Fragment
lifecycle methods onAttach
and onDetach
, which are called when a Fragment
is attached to or detached from a parent Activity
, respectively.
We showed how to associate a Canvas
with a Bitmap
, then use the Canvas
to draw on the Bitmap
. We demonstrated how to handle multitouch events so the user ...
Get Android™ How to Program, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.