7.3.4. Menu for the DoodleFragment

In Chapter 5, you used the default menu provided by the IDE to display the Flag Quiz app’s Settings menu item. You will not use the default menu in this app, so you can delete the main.xml file in your project’s res/menu folder. In this app, you’ll define your own menu for the DoodleFragment.

Menus for Different Android Versions

You’ll provide two versions of the DoodleFragment’s menu—one for Android 4.3 and earlier devices and one for Android 4.4 and higher devices. Printing is available only in Android 4.4 and higher, so only the menu for such devices will include a Print option. To support separate menus, you’ll define one menu resource in the res/menu folder and a separate menu resource in the res/menu-v19 ...

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.