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
Regular Contributor
musmankhan90
Posts: 92
Registered: ‎03-09-2013
My Device: bold 9800
My Carrier: blackberry

Error in this tutorial---> "Code sample: Playing video in a UI field in a BlackBerry device application"

[ Edited ]

Hello Every One, i am using tutorial: http://docs.blackberry.com/en/developers/deliverables/17968/CS_Play_a_video_in_a_BB_device_app_12235...

 

But when i deploy it in my device Black Berry 9800 Bold, it does not load screen, and it displays an error: "Uncaught exception: pushModal Screen called by a non-event thread"...

 

Kindly share an information with me, exactly why it happened.. I am not able to figuring it out..

 

Thank You..

Please use plain text.
BlackBerry Development Advisor (Retired)
mwoolley
Posts: 571
Registered: ‎06-25-2010
My Device: Z10
My Carrier: Vodafone

Re: Error in this tutorial---> "Code sample: Playing video in a UI field in a BlackBerry device application"

It sounds like a pushScreen is being called without considering threading. Make sure such calls are either synchronized on getEventLock() like this:

 

			synchronized (UiApplication.getEventLock()) {
				UiApplication.getUiApplication().pushScreen(next_screen);
			}

 or use invokeLater or invokeWait like this example:

 

		Application.getApplication().invokeLater(new Runnable() {
			public void run() {
				Dialog.inform("New message received");
				message.setText(msg);
			}
		});

 Hope this helps.

 

Martin

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim
Please use plain text.
Developer
peter_strange
Posts: 19,598
Registered: ‎07-14-2008
My Device: Not Specified

Re: Error in this tutorial---> "Code sample: Playing video in a UI field in a BlackBerry device application"

As the sample code does not include a pushModal, it would seem most likely that the error is caused by code that you have added. If you could identify and post this code, and explain the circumstances in which it is invoked, that would help us.  I am hoping that you should be able to identify this failing code by debugging the process on the Simulator, then this error will cause an automatic stop in the debugger, and you can use the stack trace to identify the processing in your application. 

Please use plain text.