Sans Pareil Technologies, Inc.

Key To Your Business

Exam 2 : Menus and Preferences



Develop an application using the following requirements:

  • The application will have three activities - main screen, about screen and help screen

  • All activities will display a common options menu or app bar.

  • The app bar should consist of three items

    • Settings - use to save a value that will be used to save the name to display on the main activity.

    • About - use to display the about activity

    • Help - use to display the help activity



  • The main activity should

    • Display a label (TextView) that shows the text "Name"

    • Display a text field (EditText) that displays a name if stored in preferences, or allow user to type in any name.  Any value typed in need not be saved across sessions.

    • Should not be displayed as an item in the app bar.

    • Should display the latest saved value for the name from the preferences - when user changes the stored value via the Settings menu, the value displayed in the text field should be updated.



  • The about activity should

    • Display a few lines of random text in a TextView.

    • The app bar menu item corresponding to this activity should be disabled when this activity is on screen.



  • The help activity should have the same features as the about activity (display random lines of text and the corresponding menu item should be disabled)