Plz brifly explain the meaning of ….
First i create a CustomButtonField class, and then i found out that if i din’t write the
public boolean isFocusable()
{
return true;
}
function, it doesnot responds to user events like mouse click….
and also plz explain briefly the meaning of the following functions
protected boolean navigationClick(int status, int time)
{
fieldChangeNotify(0);
return true;
}
protected boolean keyChar(char character, int status, int time)
{
if (character == Keypad.KEY_ENTER)
{
fieldChangeNotify(0);
return true;
}
return super.keyChar(character, status, time);
}
If you want a field to behave like a button
Field.FOCUSABLEstyle bit.setChangeListenerto CustomButtonField.if user clicks on this button, we can see that button has changed (
fieldChangeNotify(0);)and listener of the button works.
by this method if ‘Enter key’ pressed, button says i am changed.(
fieldChangeNotify(0);)