我是黑莓应用程序开发的新手。我正在尝试检索我的应用程序中的来电号码,并且使用Blackberry曲线设备和Blackberry触摸模拟器正常工作,但在BlackBerry Simulator Bold 9000上运行此应用程序时显示“运行”时间异常“和”错误启动:未找到符号PhoneCall.getPhoneNumber“这样,这是我的代码,
import java.io.IOException;
import net.rim.blackberry.api.phone.AbstractPhoneListener;
import net.rim.blackberry.api.phone.Phone;
import net.rim.blackberry.api.phone.PhoneCall;
import net.rim.device.api.system.RadioInfo;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.component.Dialog;
/**
* This class extends the UiApplication class, providing a
* graphical user interface.
*/
public class MyApp extends UiApplication
{
/**
* Entry point for application
* @param args Command line arguments (not used)
*/
public static void main(String[] args)
{
// Create a new instance of the application and make the currently
// running thread the application's event dispatch thread.
MyApp theApp = new MyApp();
theApp.enterEventDispatcher();
}
/**
* Creates a new MyApp object
*/
public MyApp()
{
// Push a screen onto the UI stack for rendering.
pushScreen(new HomeScreen());
Phone.addPhoneListener(new PhoneCallInterceptor());
}
}
final class PhoneCallInterceptor extends AbstractPhoneListener {
public PhoneCallInterceptor() {
}
public void callIncoming(final int callId) {
final PhoneCall call = Phone.getCall(callId);
final String number = call.getPhoneNumber(); //Here its throws an error.
}
}
任何人都可以帮助我吗?