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

Testing and Deployment

Reply
Contributor
ShaynePierce
Posts: 16
Registered: ‎09-24-2010
My Device: Bold 9700
My Carrier: TMO

9800 Simulator (OS6) Invoke Phone = JVM Error 104

I am having a problem - maybe with the simulator for 9800.  The following code works fine on 9700 simulator, but only works on 9800 simulator when I turn on the option, Run Configuration >  Simulator > Debugging > "Do not stop execution when an exception is caught by catch(Throwable)" is turned on.  I am getting the "JVM Error 104 Uncaught: NullPointerException" message and halt. If I check the box above or use the 9700 simulator I have not problems and the app works as expected.  Please help!

 

I am simply trying to have the phone dial a number on a context menu.

 

 

import net.rim.blackberry.api.invoke.Invoke;
import net.rim.blackberry.api.invoke.PhoneArguments;
import net.rim.blackberry.api.menuitem.ApplicationMenuItem;
import net.rim.blackberry.api.menuitem.ApplicationMenuItemRepository;
import net.rim.device.api.ui.component.Dialog;

public class CallHelpDesk {

	public CallHelpDesk() {
		;
	}

	public static void main(String[] args) {
		CallHelpDeskItem callHelpDeskItem = new CallHelpDeskItem(0);
		ApplicationMenuItemRepository.getInstance().addMenuItem(ApplicationMenuItemRepository.MENUITEM_CALENDAR_EVENT, callHelpDeskItem);
	}

}

class CallHelpDeskItem extends ApplicationMenuItem {	
	
	CallHelpDeskItem(int order) {
		super(order);
	}
	
	public Object run(Object context) {
		PhoneArguments makeCall = new PhoneArguments(PhoneArguments.ARG_CALL, "800-123-4567");
		try {
			Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, makeCall);
		} catch (Exception e) {
			Dialog.alert(e.toString());
		}

		Dialog.alert("Success");
		return context;
	}	
	
	public String toString() {
		return "Call Helpdesk";
	}	
}

 

 

Please use plain text.
Contributor
ShaynePierce
Posts: 16
Registered: ‎09-24-2010
My Device: Bold 9700
My Carrier: TMO

Re: 9800 Simulator (OS6) Invoke Phone = JVM Error 104

Just replying to myself here. . . .I did find that I can continue AND the next time I click I do not get the error - only the first time.  Not sure how to troubleshoot further.

Please use plain text.
Administrator
MSohm
Posts: 14,241
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: 9800 Simulator (OS6) Invoke Phone = JVM Error 104

This is an issue with the BlackBerry Smartphone Simulator, not with your application.  You shouldn't see this on a real BlackBerry Smartphone either.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.