Troubleshooting guide
41
1: Creating UIs
Interpret the status parameter of
the navigation methods.
> In your implementation of one of the navigationClick, navigationUnclick, or
navigationMovement methods of the Screen or Field classes, perform a bitwise AND
operation on the status parameter to yield more information about the event. For example, to
determine the type of input mechanism that triggered an event, in your implementation of the
navigationClick(int status, int time) method, create code such as the following:
public boolean navigationClick(int status, int time) {
if ((status & KeypadListener.STATUS_TRACKWHEEL) ==
KeypadListener.STATUS_TRACKWHEEL) {
//Input came from the trackwheel
} else if ((status & KeypadListener.STATUS_FOUR_WAY) ==
KeypadListener.STATUS_FOUR_WAY) {
//Input came from a four way navigation input device
}
return super.navigationClick(status, time); }
See the API Reference for the class net.rim.device.api.system.KeypadListener for a listing
of other status modifiers.
Respond to BlackBerry® device
user interaction.
>Use the Screen class and its subclasses to provide a menu for the BlackBerry device users to
perform actions.
Provide screen navigation when
using a
FullScreen or Screen.
Creating a MainScreen object provides default navigation to your application. Avoid using buttons or
other UI elements that take up space on the screen.
> Specify the DEFAULT_MENU and DEFAULT_CLOSE parameters in the constructor to provide default
navigation.
FullScreen fullScreen = new FullScreen(DEFAULT_MENU | DEFAULT_CLOSE);
Provice menu support. > Extend the Screen class.
Provide menu support in an
application that uses the
TrackwheelClick() method of
the
TrackwheelListener.
1. Update your application to use an extension of the Screen class.
2. In the constructor of your Screen class extension, make sure to invoke the Screen class
constructor using the DEFAULT_MENU property.
3. Make sure your extension of the makeMenu() method of the Screen class invokes
Screen.makeMenu() and adds the required menu items for the current UI application.
Task Steps