Central Button LWUIT softkey

This may seem like a very trivial problem, but I spent quite a bit of time on this without finding a viable solution.

Nokia devices have a central selection button that allows us to assign soft keys to it.

According to my requirement, I need to assign a specific command as a program key. For example, it could be β€œPlay” on one screen and β€œSelect” on another. Note that I already set the default select command using:

setDefaultCommand((Command) v.elementAt(v.size() - 1)); 

which is always the first command in the menu on the right and is called up when the central selection button is pressed.

From what I read, the way that commands are assigned to each softkey is very arbitrary and varies from device to device. Since I already have the default command installed, my problem can be solved in two ways:

1. By setting the soft key on the center button, using

 Display.getInstance().setThirdSoftButton(true); 

I tried this, but the way to assign commands is very random. In addition, the "Select" command is always added to the menu. Is there a way to configure this so that a very specific command is shown above the center button?

2. Simply assign a label so that the default command above is displayed in the center soft key.

+4
source share
1 answer

The third softbatt mode has standard implementations for many custom components, but not labels. You can customize its label by calling setSelectCommandText(String) on the component.

I suggest that instead of using a label for the central command, just use the button and set the UIID for it in Label for it if you want it to appear as a standard label.

+3
source

Source: https://habr.com/ru/post/1444052/


All Articles