我新来开发黑莓应用程序。 我试图在应用程序中检索到的呼叫号码, 以及黑莓曲线装置和黑莓触摸模拟器, 但是在对 BlackBerry 模拟器 Bold 9000 运行此应用程序时, 它显示“ 运行时间例外 ” 和“ 启动错误 : 找不到 Symbol PhoneCall. getPhone Number ” 像这样的代码, 这是我的代码,
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.
}
}
有人能帮我吗?