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 Contributor
Posts: 5
Registered: ‎04-15-2010
My Device: 9530
My Carrier: Verizon

MapField crashes with 'NullPointerException' after 'Call' button is pressed

Hello,

During the development of BB business application which uses a lot of map fields in different screens I've encountered with the following problem.

Let's consider 2 application screens. Each screen has its own map field instance.

We launch the first screen with the map field, then open the second screen with the map field and press "Call" button.

After it we press "Back" button to navigate back to the application and get a stable MapField crash with 'NullPointerException'. After the crash the mapfield on the second screen stops to render map.

 

Environment:

Simulator: Blackberry Storm 9530 4.7.0.75;

Device: Blackberry Storm 9530 4.7.0.148;

 

I'm using Blackberry JDE 4.7.0 to build the application.

 

I've also investigated Blackberry Issue Tracker and did not found any related issues.

 

Does anybody else encountered with the same problem and can tell me how to resolve such issue?

 

Thank you in advance.

 

Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: MapField crashes with 'NullPointerException' after 'Call' button is pressed

Have you looked at the call stack to determine where the NPE is coming from?

 

In my experience, NPE is user code 99.999% of the time.

 

 

New Contributor
Posts: 5
Registered: ‎04-15-2010
My Device: 9530
My Carrier: Verizon

Re: MapField crashes with 'NullPointerException' after 'Call' button is pressed

Hello RexDoug,

 

Thank you for your answer, but I've checked the stack trace several times, also I use try.. catch.. blocks in every method and log all exception information.

 

Please, also note that sometimes this repro steps can result in "Array index out of Bounds" exception or even "Illegal state exception".

 

To investigate this issues I've implemented test application with 2 screens and each screen has its own map field. The application is very simple: I launch it, the first screen with the map is opened, than open the second screen with the map, press Call button, press Back button.

Actual result: the map field crash with "Null pointer exception" or "Array index out of Bounds" exception.

This test application uses exactly the same environment as mentioned above.

 

Please also note that I use standard Blackberry MapField class without extending or overriding its functionality.