BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 09-19-2009, 02:38 PM   #1 (permalink)
New Member
 
Join Date: Jul 2009
Model: 8800
PIN: N/A
Carrier: at&t
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default How to insert menuitem in a specific position?

Please Login to Remove!

I can add the new menuItem in the existing application menu using

ApplicationMenuItemRepository.getInstance().addMen uItem(... as shown in the sample code in other threads.

but how do I add my menuItem in the specific position, or better yet, relative to the existing menuItem. For example, add a new menuItem, "Save", after the existing menuItem, "Open" for example?

Thanks in advance.
Offline  
Old 09-19-2009, 04:19 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Mar 2008
Location: Austin, TX
Model: 9700
PIN: N/A
Carrier: T-Mobile
Posts: 1,644
Post Thanks: 0
Thanked 34 Times in 33 Posts
Default

From the Javadocs:

public ApplicationMenuItem(int order)Creates a new ApplicationMenuItem instance with provided menu position.

Parameters:
order - Display order of this item, lower numbers correspond to higher placement in the menu (relative, an entry of 0 won't necessarily result in the top most item).

You'll need to play around with this ordinal value to determine where the item winds up on the menu.
Offline  




Copyright 2004-2016 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.