1

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>" +
                                "</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

Kotibab
  • 85
  • 1
  • 1
  • 7
  • NullPointerExceptions are nice because they always come with a stack-trace. This question, however, does not. – aroth Jul 29 '11 at 11:33
  • @aroth Welcome to the BlackBerry platform! I see you're new here. There are no accessible stack traces on the BlackBerry platform. – Michael Donohue Jul 29 '11 at 17:44
  • @Michael Donohue true that, I'd love to have human readable stack traces, but debugging works good for me in eclipse. – endevour Aug 02 '11 at 10:02

1 Answers1

0

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.

endevour
  • 708
  • 4
  • 12