views:

83

answers:

2

How can I add a Switch application menu item on a Screen?

+2  A: 

Hi Timoto,

It seems this question was asked before on the Blackberry support forum. From what I read it looks like you can create your own but that specific 'switch application' menu item is not a part of their public api.

Quoting RexDoug

You can still code this yourself by asking the system for running application handles, then creating a PopupScreen that holds the application icons in a single scrolling row (like the system ribbon). You would then launch the applicaiton that corresponds to the icon that the user selected.

See the API docs for ApplicationManager.getVisibleApplications() and ApplicationManager.runApplication().

We did this in just a few classes: RibbonIcon, RibbonIconField, and RibbonPopup. RibbonIconField is just a Horizontal Field Manager added to the popup screen, while RibbonIcon is just a BitmapField subclass that is clickable.

Hope this helps. -Glen

Glen Morgan
+2  A: 

You'll need to set the DEFAULT_MENU style flag at instantiation. For example:

import net.rim.device.api.ui.Screen;
import net.rim.device.api.ui.container.FullScreen;
...
    Screen myScreen = new FullScreen(Screen.DEFAULT_CLOSE | Screen.DEFAULT_MENU);

Hope this helps.

dsosby