views:

16

answers:

1

I'm having some trouble finding documentation on CLOSING a blackberry map. My map opens, albeit with some odd marker behavior, but when you close the map it displays a clear screen.

The invoke code is quite simple, as the map request calls a new controller and within the constructor is this:

String document = "<location-document>... etc";
Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments( MapsArguments.ARG_LOCATION_DOCUMENT, document));

I tried to add a close line

public boolean onClose() {
        UiApplication.getUiApplication().popScreen(this);
        return true;
    }

but this is not being applied to the map itself, but the page the map opened into. That's logical, I guess.

Maybe I'm going about this all wrong. I don't know of how to open a map another way, or if there is a way to have the close button close the map AND the containing screen. Any help is appreciated.

UPDATE
I'm surprised nobody had an answer for this since only a few horrible days of hunting resulted in a simple one line function that fixed this problem.

public void onExposed()
    {
        UiApplication.getUiApplication().popScreen(this);
    }

Adding that to the map controller closes the map application when the user clicks the back button. Simple as that.

A: 

solved. see above.

fleces