Advertisement
Guest User

Untitled

a guest
Jun 20th, 2012
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.47 KB | None | 0 0
  1. // add this code to public static void main(String[] args) - START
  2.  
  3. ApplicationMenuItemRepository amir = ApplicationMenuItemRepository.getInstance();
  4. RuntimeStore store = RuntimeStore.getRuntimeStore();
  5.  
  6. if(store.get(ApplicationMenuItemRepository.MENUITEM_SYSTEM) == null)
  7.            {
  8.        try
  9.            {
  10. store.put( ApplicationMenuItemRepository.MENUITEM_SYSTEM, amir );
  11.            }
  12. catch(IllegalArgumentException e){}
  13. ApplicationDescriptor ad_startup = ApplicationDescriptor.currentApplicationDescriptor();
  14. ApplicationDescriptor ad_inapp = new ApplicationDescriptor(ad_startup , "inapp", new String[]{"inapp"});
  15. amir.addMenuItem(ApplicationMenuItemRepository.MENUITEM_BROWSER , new BrowserMenuItem() , ad_inapp);
  16.            }
  17. // add this code to public static void main(String[] args) - END
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31. // here is the menu class ------------------------------------------------------------------------
  32.        private static class BrowserMenuItem extends ApplicationMenuItem {
  33.         BrowserMenuItem() {
  34.             super(0);
  35.         }
  36.        
  37.  public String toString()
  38.     {
  39.         return "take the url";
  40.     }        
  41.  
  42.  
  43.     public Object run(Object context)
  44.     {
  45.         {
  46.           String urlStringg = context.toString();
  47.           UiApplication app = UiApplication.getUiApplication();
  48.           app.pushScreen(new YOUCLASSNAME(urlStringg));
  49.           app.requestForeground();
  50.                
  51.         }
  52.         return null;
  53.     }
  54.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement