Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // add this code to public static void main(String[] args) - START
- ApplicationMenuItemRepository amir = ApplicationMenuItemRepository.getInstance();
- RuntimeStore store = RuntimeStore.getRuntimeStore();
- if(store.get(ApplicationMenuItemRepository.MENUITEM_SYSTEM) == null)
- {
- try
- {
- store.put( ApplicationMenuItemRepository.MENUITEM_SYSTEM, amir );
- }
- catch(IllegalArgumentException e){}
- ApplicationDescriptor ad_startup = ApplicationDescriptor.currentApplicationDescriptor();
- ApplicationDescriptor ad_inapp = new ApplicationDescriptor(ad_startup , "inapp", new String[]{"inapp"});
- amir.addMenuItem(ApplicationMenuItemRepository.MENUITEM_BROWSER , new BrowserMenuItem() , ad_inapp);
- }
- // add this code to public static void main(String[] args) - END
- // here is the menu class ------------------------------------------------------------------------
- private static class BrowserMenuItem extends ApplicationMenuItem {
- BrowserMenuItem() {
- super(0);
- }
- public String toString()
- {
- return "take the url";
- }
- public Object run(Object context)
- {
- {
- String urlStringg = context.toString();
- UiApplication app = UiApplication.getUiApplication();
- app.pushScreen(new YOUCLASSNAME(urlStringg));
- app.requestForeground();
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement