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