Answers to Self-Review Exercises

7.1

a) SensorEventListener.

b) curves.

c) dragged across the screen.

d) unregisterListener.

e) onSensorChanged.

f) onAttach.

g) onDraw.

h) getActionMasked.

i) immersive mode.

7.2

a) False. You unregister the accelerometer event handler when the app is sent to the background.

b) False. Call the inherited View method invalidate to indicate that the View needs to be redrawn.

c) False. If the action is MotionEvent.ACTION_DOWN or MotionEvent.ACTION_POINTER_DOWN, the user touched the screen with a new finger.

d) False. Resetting the Path does not erase its corresponding painted line from the screen, because those lines have already been drawn to the bitmap that’s displayed to the screen.

e) False. The method MediaStore.Images.Media.insertImage saves a Bitmap into the device’s Gallery.

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

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