I overridden the makeContextMenu() method, but this is never called...(I tried to put a breakpoint on this method and then from the simulator I clicked on the field to get the context menu but the method NEVER gets called).

Why such beahavior?

I really can't manage to understand what I'm missing...maybe a stupid thing...I would appreciate any help

Context menus are only shown when a field has focus. You typically would put the makeContextMenu method in a field that would get focus, then the context menu for that field will be displayed when the users clicks the menu button.

Screens don't really get focus, the only reason why MainScreen has MakeContextMenu is because it inherits it from Field.

For example, in this screenshot below, I added "Next 10", "View Map" from the mainscreens MakeMenu method. The "View Apartment" comes from the selected field's context menu... if that makes sense.

Context menus are only shown when a field has focus. You typically would put the makeContextMenu method in a field that would get focus, then the context menu for that field will be displayed when the users clicks the menu button.

Screens don't really get focus, the only reason why MainScreen has MakeContextMenu is because it inherits it from Field.

I know this, but see my image...when I click on the field while this has focus nothing happens :( why?

1) Following the book I'm reading about Blackberry development, this method also shows up the context menu while clicking on a field, because we don't do any check on instance (I undrstood that in instance I have an int that tell me if the menu is contextual or main), so without any if-else I should see the contextual menu by clicking on a field (the images on the book show context menu!)
But in my simulator this code only work for main men¨ (clicking on berry button).

No problems on the "simple" questions - it's tricky stuff, especially if you haven't worked extensively with Java and inner classes before.

Whenever you want to do something like add a context menu to a field, override the paint method to change the color of the text, etc, you will probably use an inner class. Look at the "myLabel" field in the example below, you should be able to just copy and paste this and be good to go.

I know inner classes and I worked with Java, but I think there should be a better method to obtain context menu...or do I really have to override contextMenu for *every field* I want to have the context menu?