04-15-2010 11:18 AM
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.
Simulator: Blackberry Storm 9530 18.104.22.168;
Device: Blackberry Storm 9530 22.214.171.124;
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.
04-15-2010 02:23 PM
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.
04-16-2010 02:44 AM
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.