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: 205
Registered: ‎07-14-2008
My Device: 7230, 8700, 8820, 9000

Bizzare ApplicationMenuItem issue

I am testing on a pair of Bolds running 4.6.0.162

 

I'm trying to install a SYSTEM level ApplicationMenuItem into my app, but it keeps throwing a java.lang.Error at runtime with the message "null".  The problem goes away if I manually set "Organizer Data" to Allow (in addition to Cross Application Communication being set to Allow).  However, on the second device I set Organizer Data to Deny, and the application menu item is installed without a problem.  

 

This is very bizzare behaviour that I really cannot figure out.  I'd love to here any else's insights into the problem.  Following is the code:

 

 

ApplicationMenuItem m_pMenuItem = null;

 

...

 

try
{
m_pMenuItem = new SnapshotMenuItem();

ApplicationMenuItemRepository pRepo =
ApplicationMenuItemRepository.getInstance();

System.out.println(m_pMenuItem.toString()); // correctly prints the menu item name
pRepo.addMenuItem(
ApplicationMenuItemRepository.MENUITEM_SYSTEM, m_pMenuItem);
}
catch (final ControlledAccessException e)
{
m_pMenuItem = null;
return false;
}
catch (final Throwable e)
{
System.out.println(e.toString() + " " + e.getMessage());
}

 This code will print the name of the application menu item followed by a new line containing "java.lang.Error null"

 

 

Earl

 

Earl Oliver
Developer
Posts: 205
Registered: ‎07-14-2008
My Device: 7230, 8700, 8820, 9000

Re: Bizzare ApplicationMenuItem issue

[ Edited ]
After giving up in frustration, I reinstalled the OS and the problem temporarily went away.  I have been able to reproduce the problem.

 

Earl

Message Edited by eaoliver on 04-30-2009 05:26 PM
Earl Oliver
Highlighted
Developer
Posts: 205
Registered: ‎07-14-2008
My Device: 7230, 8700, 8820, 9000

Re: Bizzare ApplicationMenuItem issue

Bump.

 

It would be nice to know if this is a known issue.  Asking users for "Organizer permission"  to add an application menu item seems pretty suspicious.

 

Earl

Earl Oliver