| | 06-04-2012, 08:28 AM Thread Author #1
The ListField object and annoying context menu
Couple days ago I have discovered a strange bug in my app.
I have two Screen objects:
- Screen1, which displays the ListField control,
- Screen2, which displays the data of an item selected through the ListField control.
Now, when I select an item on the ListField control (on the Screen1) and then press the trackpad, the Screen2 appears, but also a context menu is displayed that belongs to Screen1 (Screen1 and Screen2 objects have different context menus).
I have tried everything that is known to me to overcome this issue, but... with no success so far.
The navigation click is handled in the following way (Screen1):
protected boolean navigationClick(int status, int time)
Field field = this.getFieldWithFocus();
if (field instanceof ListField)
// here I'm getting the element data from the ListField object
Screen2 screen2 = new Screen2();
return super.navigationClick(status, time);
protected boolean navigationUnclick(int status, int time)
The ListField control is initialized as follows (also Screen1):
lstData = new ListField(0, Field.FIELD_HCENTER);
lstData.setMargin(2, 2, 2, 2);
I have no idea what's wrong with this code... I tried to use ButtonField.CONSUME_CLICK style - but this also does not work.
What's more interesting, this context menu does not appear on the 9800 simulator - at least I was unable to see it on this simulator. But when I'm testing this app on my 9780 device, the context menu appears every time.