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
New Developer
joaogalli
Posts: 12
Registered: ‎04-14-2008
My Device: Not Specified
Accepted Solution

MenuItem in FileExplorer can't open Dialog or PopupScreen.

Hi,

 

I would like to know why I can't open a Dialog or a PopupScreen from a menuitem in the File Explorer.

 

Using the debugger I can see that there is no error ocurring and the execution get there in the Dialog.alert(""),

is there any solution?

João Eduardo Galli
Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: MenuItem in FileExplorer can't open Dialog or PopupScreen.

Have you tried dialog.alert() in Invokelater?

Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
New Developer
joaogalli
Posts: 12
Registered: ‎04-14-2008
My Device: Not Specified

Re: MenuItem in FileExplorer can't open Dialog or PopupScreen.

Hi, I tried it in the 4.5 API but doesn't worked.
João Eduardo Galli
Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: MenuItem in FileExplorer can't open Dialog or PopupScreen.

Can you putup you code.

Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.
New Developer
joaogalli
Posts: 12
Registered: ‎04-14-2008
My Device: Not Specified

Re: MenuItem in FileExplorer can't open Dialog or PopupScreen.

Ok,

 

this is what I use to register the MenuItem (and it is shown in the FileExplorer):  

 

 

ApplicationMenuItemRepository instance = ApplicationMenuItemRepository.getInstance(); ApplicationDescriptor apd = ApplicationDescriptor.currentApplicationDescriptor(); instance.addMenuItem(ApplicationMenuItemRepository.MENUITEM_FILE_EXPLORER_BROWSE, myMenuitem, apd, "image/jpg");

 


 

And this is my MenuItem:

 

 

public class TwiThisMenuItem extends ApplicationMenuItem { public TwiThisMenuItem(int order) { super(order); } public String toString() { return "Twit This!"; } public Object run(final Object context) { Application.getUiApplication().invokeLater(new Runnable() { public void run() { Dialog.alert("Test"); // This doesn't work. } }); return context; }}

 

João Eduardo Galli
Please use plain text.
Developer
BBDeveloper
Posts: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: MenuItem in FileExplorer can't open Dialog or PopupScreen.

Check this KB article.

 

http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/...


Use Search. "Accept Solution" If the problem is resolved.
Please use plain text.