7.5. DoodleFragment Class

Class DoodleFragment (Figs. 7.127.19) displays the DoodleView (Section 7.6), manages the menu options displayed on the action bar and in the options menu and manages the sensor event handling for the app’s shake-to-erase feature.

 1   // DoodleFragment.java 2   // Fragment in which the DoodleView is displayed 3   package com.deitel.doodlz; 4  5   import android.app.Fragment; 6   import android.content.Context; 7   import android.graphics.Color;               8   import android.hardware.Sensor;              9   import android.hardware.SensorEvent;        10   import android.hardware.SensorEventListener;11   import android.hardware.SensorManager;      12   import android.os.Bundle;13    ...

Get Android™ How to Program, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.