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
Developer
malcolm
Posts: 41
Registered: ‎08-01-2008
My Device: Not Specified
Accepted Solution

Difference between device and simulator as regards "consuming" input with GUI.

I have a simple GUI built which seems to perform as I would expect on the simulator, but on the device every time I press enter on a ButtonField, at the same time as running the code in the FieldChangeListener attached to that button, I get a little menu at the bottom middle of the screen which only has one entry, "Full Menu". I have to press escape after each other button press to get this to go away. I have had a look to see if there is something I should be doing to indicate that the button handlers are "consuming" the input, as it seems that this might be due to the underlying MainScreen class receiving the input as well, but since the fieldChanged method I implement returns void I can't see where I should indicate this. I don't get this behaviour in the simulator.

 

Can anyone tell me how to avoid this effect? Thankyou!

Please use plain text.
Administrator
MSohm
Posts: 14,512
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: Difference between device and simulator as regards "consuming" input with GUI.

Add the ButtonField.CONSUME_CLICK style when creating your ButtonField and it should consume the click, preventing the menu from appearing.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
Developer
malcolm
Posts: 41
Registered: ‎08-01-2008
My Device: Not Specified

Re: Difference between device and simulator as regards "consuming" input with GUI.

Great, that's exactly what I needed. Thanks for your prompt response.
Please use plain text.