Sofia API Reference

  • Package Index
  • Class Index
  • Packages
  • sofia.app
    • Interfaces
    • ScreenMethods
    • Classes
    • ActivityStarter
    • ListScreen
    • Screen
    • ShapeScreen
    • Annotations
    • OptionsMenu
    • Persistent
    • Persistor
    • ScreenLayout
  • sofia.content
  • sofia.data
  • sofia.graphics
  • sofia.util
  • sofia.view
  • sofia.widget

public abstract @interface
OptionsMenu

implements Annotation

Inheritance

  • sofia.app.OptionsMenu

Class Overview

Use this annotation on a subclass of Screen to specify the menu resource that should be loaded when the user presses the Menu button.

This annotation supports three usage forms:

@OptionsMenu("foo")
This will search for a menu defined in the project's res/menu/foo.xml file. This is the preferred form, since it performs a more advanced search than the numeric "id" form below.
@OptionsMenu(id = R.menu.foo)
This will find the same menu as above, but using the auto-generated numeric ID of the menu resource instead.
@OptionsMenu
When specified without parameters, a lookup based on the name of the class is performed. For example, if the annotation is placed on a class named MyScreen, then this will search for a menu in res/menu/myscreen.xml, followed by res/menu/my_screen.xml.

This annotation must be present for the screen to have an options menu that is automatically loaded from a resource.


Summary

Methods inherited from interface java.lang.annotation.Annotation
abstract Class<? extends Annotation> annotationType()
abstract boolean equals(Object arg0)
abstract int hashCode()
abstract String toString()