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
Contributor
haga_rakotobe
Posts: 11
Registered: ‎05-21-2012
My Device: multi-device (developer)
Accepted Solution

NullPointerException in Screen#navigationMovement handler

[ Edited ]

Hi

 

After adding a VerticalFieldManager to a screen, the screen's super's navigationMovement handler throws a NullPointerException and the verticalFieldManager won't scroll with the trackpad from this point (using the enter key to scroll works fine, and after scrolling once the trackpad works again).

 

I am using the same pattern as this post, setting focusable NullField on top and bottom of the vertical scrollable field.Did anyone have the same issues or have ideas on places worth looking for ?

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: NullPointerException in Screen#navigationMovement handler

Can you post here a simple example of this problem that we can cut/paste into our test program and demonstrate the problem?

Contributor
haga_rakotobe
Posts: 11
Registered: ‎05-21-2012
My Device: multi-device (developer)

Re: NullPointerException in Screen#navigationMovement handler

I am sorry, I couldn't reproduce it with a simple sample. After a few hours I got to solve the problem by changing the field hierachy of my screen, adding a top field manager accepting the focus no matter what's inside it.

 

I think it throwed NullPointerException because it couldn't find a field to focus when the first navigation movement occured, or the system tried to latch the focus on an unfocusable element. I don't have the final conclusion, I could work around it by rearranging the fields.

Developer
peter_strange
Posts: 19,610
Registered: ‎07-14-2008
My Device: Not Specified

Re: NullPointerException in Screen#navigationMovement handler

Glad you have solved this then.  Can you please mark it as solved?  See the Help link near the top of the screen if you don't know how to do this.