If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
wfilla
Posts: 41
Registered: ‎01-27-2011
My Device: Not Specified
Accepted Solution

Error trying to use custom BB map CommandHandler not found

I keep getting the error that the net.rim.device.api.Command.CommandHandler is not found when I try to add any type of code to my app to open a custom map. I've searched the api, this board, and all the samples and still can't seem to come up with a way to make this work. Here is the latest version of the code I have:

 

 

    public class InvokeMapViewScreen
    {      
        
        InvokeMapViewScreen()
        {
                           
            MenuItem viewMapItem = new MenuItem(new StringProvider("View Map") , 0x230010, 0);
            viewMapItem.setCommand(new Command(new CommandHandler()
            {
             
                public void execute(ReadOnlyCommandMetadata metadata, Object context)
                {
                    MapView mapview = new MapView();
                    mapview.setLatitude(38785101);
                    mapview.setLongitude(-90602145);
                    mapview.setZoom(3);
                   
                    Invoke.invokeApplication(Invoke.APP_TYPE_MAPS, new MapsArguments(mapview));
                }
            
            }));
            
            addMenuItem(viewMapItem);   
        }
        
    }

 

 

 

My app won't run, and I keep getting the error CommandHandler not found. Does anyone have any ideas on how I can get this to work?

Please use plain text.
Developer
jprofitt
Posts: 604
Registered: ‎12-27-2010
My Device: Not Specified

Re: Error trying to use custom BB map CommandHandler not found

My guess is you're developing for a pre-6.0 OS. Are you just trying to open the map application to a specific location?

Please use plain text.
Contributor
wfilla
Posts: 41
Registered: ‎01-27-2011
My Device: Not Specified

Re: Error trying to use custom BB map CommandHandler not found

Yes and Yes. Please oh please tell me that you know how to get this to work??

Please use plain text.
Developer
jprofitt
Posts: 604
Registered: ‎12-27-2010
My Device: Not Specified

Re: Error trying to use custom BB map CommandHandler not found

Please use plain text.
Contributor
wfilla
Posts: 41
Registered: ‎01-27-2011
My Device: Not Specified

Re: Error trying to use custom BB map CommandHandler not found

Thank you so much! I've got it working now. Yeah!

Please use plain text.