0
我使用jde 4.5希望通过我的应用程序使用相机。 我写的代码和得到运行时exceletion Pushmodelscreen由非事件线程caled 告诉我它的问题是什么?启动相机问题?
公共无效启动照相机()
{
try {
// Create a player for the Blackberry's camera
Player player= Manager.createPlayer("capture://video");
// Set the player to the REALIZED state (see Player javadoc)
player.realize();
// Grab the video control and set it to the current display
_videoControl = (VideoControl)player.getControl("VideoControl");
if (_videoControl != null)
{
// Create the video field as a GUI primitive (as opposed to a
// direct video, which can only be used on platforms with
// LCDUI support.)
_videoField = (Field) _videoControl.initDisplayMode (VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field");
_videoControl.setDisplayFullScreen(true);
_videoControl.setVisible(true);
}
player.start();
if(_videoField!=null)
{
add(_videoField);
}
}赶上(例外五){// TODO:处理异常 Dialog.alert(e.getMessage()); }} `
thnaks很多 阿米特
'Pushmodelscreen caaled by non event thread' 这个错误通常发生在弹出屏幕或'Dialog.alert'需要在任何屏幕被推动之前显示。 – Prasham 2010-11-19 11:01:42