Java Reference
In-Depth Information
(a)
(b)
Figure 4.6 Reduced button layout on a) Nokia N95 and b) Sony Ericsson W960i
from the Options menu and the Sony Ericsson W960i user has to open
the More menu to choose the Reply option.
We can change the command type of one of the commands to map to
a different softkey. The following code changes the Dismiss action to be
of command type CANCEL .
private Command dismiss = new Command("Dismiss", Command.CANCEL, 0);
private Command reply = new Command("Reply", Command.OK, 0);
The MIDP specification says this about command type CANCEL :
The application hints to the implementation that the user wants to
dismiss the current screen without taking any action on anything that
has been entered into it.
As you can see in Figure 4.7, that produces the correct result on the
Nokia N95 (as Dismiss is mapped to the Back button, the only remaining
option, Reply, is mapped to the other softkey). On the Sony Ericsson
W960i, the Dismiss command has been mapped to the system button at
the top right of the screen.
That is probably the right thing to do as it respects the native platform
usage policy. In some cases, you may prefer both Sony Ericsson W960i
and Nokia N95 users to see a softkey with a Dismiss label. Let's change
the Dismiss command to be of type BACK and see what happens:
private Command dismiss = new Command("Dismiss", Command.BACK, 0);
private Command reply = new Command("Reply", Command.OK, 0);
Search WWH ::




Custom Search