English 中文(简体)
在BlackBerry Bold 9000模拟器中找不到 Phone 数字
原标题:Symbol PhoneCall.getPhoneNumber not found in BlackBerry Bold 9000 simulator
  • 时间:2012-05-25 06:32:55
  •  标签:
  • blackberry

我新来开发黑莓应用程序。 我试图在应用程序中检索到的呼叫号码, 以及黑莓曲线装置和黑莓触摸模拟器, 但是在对 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.

  }
}

有人能帮我吗?

最佳回答

< a href=> http://www.blakberry.com/ developingers/docs/7.1.0api/net/rim/blakberry/api/phoneCall.html" rel="no follow" >PhoneCall .getPhoneNation () 是在OS 4.7. 中添加的。您黑色BlackBerry 9000 simulator 可能正在运行 OS 4. 6, 所以这个方法不存在。 最佳的替代方法是 < a href=" http://www. blakberry.com/ Developers/docs/7.1.0api/net/rim/blakberry/api/ phone/phone/ PhoneCall.html" rel="nofolpol < a. getpol <.getdisplayPhonePhoneNet () 但是如果数字与设备联系列表中的任何用户匹配, 任何用户, 则只能给你电话号码。

问题回答

暂无回答




相关问题
How does AlertListener work on Blackberry API 5.0?

Does the AlertListener interface works globally on all alerts on the blackberry device, or does it only work with alerts generated by your application? In other words, can I use this interface to ...

How to buffer audio in Blackberry?

I need to learn how to buffer audio stream from a remote server in Blackberry. There is a sample buffered playback app with Blackberry api but can you tell what url may I use to test the application?

Blackberry push notification implementation

How does one implement a push notification for a blackberry app? I heard that in order to do so I need to purchase a Blackberry Enterprise Server which costs me 1400 per year. Is this true? Where is ...

热门标签