Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Doubts abt menu outside the application

Hi ,i want to know is it Possible to have my menu with menus such as HIde,Delete ,Switch Application etc in it,I have attached the image .and i want to know whether can i have my menu in this place.and on clicking it to switch over to application.

 

Regards

 

Rakesh Shankar.P

Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Doubts abt menu outside the application

[ Edited ]

Hi guys ,i figured out that we can use

 

ApplicationMenuItem, and ApplicationMenuItemRepository. for getting mymenu in the application.But i cann't get the custom menu why?

 

 

 

public class Main extends Application
{
    Main()
    {
      
       MyMenuItem myMenuitem = new MyMenuItem(0);
       ApplicationMenuItemRepository.getInstance().addMenuItem( ApplicationMenuItemRepository.MENUITEM_SYSTEM,myMenuitem);
             
      //  ApplicationMenuItemRepository.getInstance().addMenuItem(ApplicationMenuItemRepository.MENUITEM_CALENDAR,myMenuitem); 
       
    }
    public static void main(String arg[])
    {
        Main m=new Main();
        m.enterEventDispatcher();
    }

}

 

 

 

 

class MyMenuItem extends ApplicationMenuItem{

    //using the default constructors here.
    MyMenuItem(int order){
        super(order);
    }

    //methods we must implement
    //Run is called when the menuItem is invoked
    public Object run(Object context){
        //context object should be a email message
        if (context instanceof Message){
            Message message = (Message)context;
            //this is where we would work the message
          //do something here
        }
        return context;
    }

    //toString should return the string we want to
    //use as the lable of the menuItem
    public String toString(){
        return "MyMenu Name";
    }
}

 

 

AnyIdeas i am not gettting any menu.Help needed.

 

 

 

Regards

Rakesh Shankar.P

 

 

 

Developer
Posts: 1,006
Registered: ‎05-22-2009
My Device: Not Specified

Re: Doubts abt menu outside the application

Hi Guys,I used storm simulator and stil not able to acheive custom menus.Any Ideas?