Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Developer
shoestring
Posts: 2
Registered: ‎09-08-2008
My Device: Curve 8320
Accepted Solution

navigationUnclickUnhandled seems to put "Full Menu" on my Screen

Simulator: 8330

 

I see the "Full Menu" text at the bottom of my BB screen after I change the value of an on-screen field. This seems to be happening because of a navigationUnclickUnhandled "event." I'm not sure how to avoid this unexpected behavior.

 

 

btnCalculate.setChangeListener(new FieldChangeListener() {

public void fieldChanged(Field field, int context) {
if (context != FieldChangeListener.PROGRAMMATIC) {
double mpg = calculateMpg(milesDriven.getText(), gallons.getText());
System.out.println("MPG: " + mpg);
String clipboardDate = (new SimpleDateFormat("MM/dd/yyyy")).formatLocal(entryDate.getDate());
float roundedMpg = (float)((int)(mpg*10000)) /(float)10000;
String outputText = vehicleChoice.toString() + ": " + clipboardDate + " " + roundedMpg;
Clipboard.getClipboard().put(outputText);
outputLine.setText(outputText);
} else {
System.out.println("System changed button");
}
}
});

 Stepping through the debugger, the following occurs just before the "Full Menu" menu is displayed in the bottom center of the screen:

 

DataEntryScreen(Screen).navigationUnclickUnhandled(int, int) line: 3986

If I comment the outputLine.setText(outputText); statement, the unwanted prompt doesn't appear. I don't know how to "handle" the navigationUnclick.

 

I'd like to display the results of the calculation on the screen, but if there is a better way to do it, I'm open to suggestions!

 

 

 

Please use plain text.
New Developer
shoestring
Posts: 2
Registered: ‎09-08-2008
My Device: Curve 8320

Re: navigationUnclickUnhandled seems to put "Full Menu" on my Screen

Solved it.

Define the Calculate button as follows

 

ButtonField btnCalculate = new ButtonField("Calculate", ButtonField.CONSUME_CLICK+ButtonField.FIELD_HCENTER);

 


 

 

Please use plain text.