How to add switch functionality?

How do I add a Toggle app menu item to the screen?

+2


a source to share


2 answers


You need to set the DEFAULT_MENU style flag when instantiating. For instance:

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 it helps.

+2


a source


It seems this question has been asked before on the Blackberry support forum . From what I've read, it looks like you can create your own, but this particular "switch application" menu item is not part of their public api.

Quote RexDoug



You can still program this yourself by asking the system to launch application descriptors and then create a PopupScreen that contains the application icons on a single scroll bar (like the system ribbon). Then you will launch the application corresponding to the user-selected icon.

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

We did this in just a few classes: RibbonIcon, RibbonIconField, and RibbonPopup. RibbonIconField is just the horizontal field manager added in the popup, and RibbonIcon is just a clickable BitmapField subclass.

Hope this helps. -Glen

+2


a source







All Articles