08-04-2008 10:22 PM
I'm trying to capture the Selected Index of a menu from a J2EE MIDlet. I'm using TrackwheelListener. The menu appears in a class that extends Form. When I use the following RIM classes from within the MIDlet this is what's returned:
UiApplication uia = UiApplication.getUiApplication();
Screen scre = uia.getActiveScreen();
Field field = scre.getFieldWithFocus();
Variable scre is type:
Variable field is type: net.rim.device.api.ui.menu.DefaultMenuListField
Variable field has all the goodies that I need to access. field._items is an array of MenuItems, and field._selection has the selected index.....
Has anyone had any success capturing the MenuItem from within a MIDlet. I know about the depreciated API but the alternative is very inconsistant and limited trackball useage.
08-07-2008 01:06 PM - edited 08-07-2008 01:07 PM
The intermixing of GUI elements of BlackBerry CLDC applications and MIDlets is not supported. Other APIs can be intermixed.
You can add custom items to the menu of a MIDlet by adding commands. There is no method that directly returns the currently selected menu item.
What action are you trying to accomplish by getting the selected menu item?