我正在尝试使用以下代码绘制路线
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>" +
"</location-document>";
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments( MapsArguments.ARG_LOCATION_DOCUMENT, document));
它在Blackberry 9700 OS6中运行完美。但是在9700 OS5和8900模拟器中它在加载时显示空指针异常。当我在8900中测试时,设备地图没有显示。我该如何纠正这个问题。
谢谢 G.Koti Babu
答案 0 :(得分:0)
在真正的8900设备上尝试了您的代码。它在10次中有8次完美无瑕。
2次失败的测试确实抛出了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
似乎是某种错误。你不能抓到任何东西。在调用应用程序后,您无法进行任何进一步的调查。该应用程序是独立的。你的代码没有错。