0

i've read this article about this "How to show our own icon in BlackBerry Map?" and i want to put it on my project, and calling the Scr() class from the menu item :

MenuItem _openAction = new MenuItem("MyLocation",100000,10) {

    public void run() 
    {
        UiApplication.getUiApplication().pushScreen(new Scr());

    }

};

but i get error ""jvm error 104 uncaught runtime exception" when i calling it from menu "MyLocation". i tried before but i calling the Scr() class from the main screen and its working well.

public invokeMaps()
{


    pushScreen(new Scr());


}

since I'm new to this whole thing i can't figure it out where the problem is... any help would be really mean a lot to my project.. thanks before :)

Community
  • 1
  • 1

1 Answers1

0

As you can see in this thread, the 104 error is shown for all uncaught exceptions in the simulator. I suggest you wrap the code inside the run method in a try / catch block and see if you can get a more detailed exception.

There are many things that could have gone wrong, for example if you call getLocation inside Scr() you will get an exception, cause this function call cannot be made on the ui thread.

Another thing to try is to separate the creation on the Scr class from the push screen and see where the exception is thrown:

try{
    Scr myScr = new Scr();
    UiApplication.getUiApplication().pushScreen(myScr);
} catch (Exception ex) {
    // take a look at the exception message
}
Tamar
  • 2,016
  • 1
  • 15
  • 26