I am trying to draw route by using following code
String document = "<location-document>" +
"<GetRoute>" +
"<location lon='-8030000' lat='4326000' label='Kitchener, ON' description='Kitchener, Ontario, Canada' />" +
"<location lon='-7569792' lat='4542349' label='Ottawa, ON' description='Ottawa, Ontario, Canada' />" +
"</GetRoute>" +
"</开发者_JS百科location-document>";
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments( MapsArguments.ARG_LOCATION_DOCUMENT, document));
It works perfect in Blackberry 9700 OS6.But in 9700 OS5 and in 8900 simulator it showing null pointer exception when loading.When i am testing in 8900 device map is not displaying. How can i rectify the problem.
Thank You G.Koti Babu
Tried your code on a real 8900 device. In 8 out of 10 times it worked flawless.
The 2 failed tests did throw NullPointerExceptions
Thread [net_rim_bb_lbs(256)id=277702656] (Suspended (exception NullPointerException))
MapRect.intersects(short[]) line: 74
MapRender.renderLayer(BaseDataSource, Graphics, Maplet, Layer, MapRect, int, int, XYRect, XYRect) line: 331
MapRender.render(BaseDataSource, RenderListener, Graphics, MapRect, int, int, XYRect, XYRect) line: 483
BaseMapRenderer.render(BaseDataSource, RenderListener, Graphics, MapRect, MapRect, int, int, int, int, XYRect, XYRect) line: 47
BaseDataSource.render(RenderListener, Graphics, MapRect, MapRect, int, int, int, int, XYRect, XYRect, Transform) line: 247
RenderThread.renderImpl(Graphics, MapRect, MapRect, int, int, int, int, XYRect, XYRect) line: 259
RenderThread.run() line: 346
Seems to be some kind of bug. You can't catch anything there. After invoking an application, you are out of reach for any further investigations. The app is on its own. You're doing nothing wrong in your code.
精彩评论