2012-05-25 1 views
0

Blackberry 응용 프로그램 개발에 익숙합니다. 응용 프로그램에서 수신 전화 번호를 검색하려고하는데 Blackberry 곡선 장치 및 Blackberry 터치 시뮬레이터로 정상적으로 작동하지만 9000 블랙 베리 볼드 시뮬레이터에이 응용 프로그램은 "실행 시간 예외"및 표시 "오류 시작 : 기호 PhoneCall.getPhoneNumber가 발견되지 않는"Symbol 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. 

    } 
} 

이 하나가 나를 도울 수, 내 코드는 여기에, 이런 식으로?

답변

1

PhoneCall .getPhoneNumber()가 OS 4.7에 추가되었습니다. BlackBerry 9000 시뮬레이터는 OS 4.6을 실행 중이므로이 방법은 없습니다. 가장 좋은 대안은 PhoneCall입니다 .getDisplayPhoneNumber()하지만 전화 번호는 장치 대화 상대 목록의 사용자와 일치하지 않는 경우에만 제공됩니다. 전화 번호가 연락처와 일치하면 연락처 이름을 대신 받게됩니다.

관련 문제