Code example for SubMenu

Methods: add, setIcon

0
  } 
 
  static void insert_download_menu(Menu parent) {
      SubMenu m_download =
        parent.addSubMenu (0, 0, Menu.NONE, "Download(s)");
      m_download.setIcon(android.R.drawable.ic_menu_view);
      m_download.add (Menu.NONE, OPTION_DOWNLOAD_BASE + DOWNLOAD_SINGLE, Menu.NONE, "Central tile");
      m_download.add (Menu.NONE, OPTION_DOWNLOAD_BASE + DOWNLOAD_LEV_0, Menu.NONE, "Missing ..,0 levels");
      m_download.add (Menu.NONE, OPTION_DOWNLOAD_BASE + DOWNLOAD_LEV_1, Menu.NONE, "Missing ..,0,1 levels");
      m_download.add (Menu.NONE, OPTION_DOWNLOAD_BASE + DOWNLOAD_LEV_2, Menu.NONE, "Missing ..,0,1,2 levels");
      m_download.add (Menu.NONE, OPTION_DOWNLOAD_BASE + DOWNLOAD_LEV_0_ROUTE, Menu.NONE, "Missing ..,0 on route");
      m_download.add (Menu.NONE, OPTION_DOWNLOAD_BASE + DOWNLOAD_MISSING, Menu.NONE, "Recent missing");
      m_download.add (Menu.NONE, OPTION_DOWNLOAD_BASE + DOWNLOAD_LEV_0_FORCE, Menu.NONE, "Force ..,0 levels");
      m_download.add (Menu.NONE, OPTION_DOWNLOAD_BASE + DOWNLOAD_33, Menu.NONE, "3x3 region");
      m_download.add (Menu.NONE, OPTION_DOWNLOAD_BASE + DOWNLOAD_55, Menu.NONE, "5x5 region");
  } 
 
   static boolean decode_download_option(int subcode, Context context, Map map) {
     switch (subcode) {
       case DOWNLOAD_SINGLE:
         map.trigger_fetch_around(0, context);