0
我是黑莓應用程序開發的新手。我試圖在我的應用程序中檢索來電號碼,並且使用Blackberry曲線設備和Blackberry touch模擬器正常工作,但是在運行在BlackBerry模擬器這個應用粗體9000顯示「運行時異常」和「錯誤啓動:符號PhoneCall.getPhoneNumber沒有找到」像這樣的,這裏是我的代碼,符號PhoneCall.getPhoneNumber在BlackBerry Bold 9000模擬器中找不到
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.
}
}
任何一個能幫助我嗎?