黑莓:InCall Screen

时间:2011-10-24 13:00:26

标签: blackberry

我想在来电期间显示我的屏幕。 有没有办法覆盖Blackberry的InCall屏幕?

1 个答案:

答案 0 :(得分:1)

您可以使用PhoneListener接口,然后覆盖方法来执行相同操作。

public class CatchCall extends Application implements PhoneListener {

    boolean yes = false;
    int st;

    public CatchCall() {
        Phone.addPhoneListener(this);
    }

    public static void main(String[] args) {
        new CatchCall().enterEventDispatcher();
    }

    public void callAdded(int callId) {
    }

    public void callAnswered(int callId) {
    }

    public void callConferenceCallEstablished(int callId) {
    }

    public void callConnected(int callId) {

        // TODO Auto-generated method s
        PhoneCall phoneCall = Phone.getCall(callId);
        if (phoneCall != null) {               
                //TODO: push your screen here
                Dialog.ask(Dialog.D_YES_NO, "Push my screen here");
        }
    }

    public void callDirectConnectConnected(int callId) {
    }

    public void callDirectConnectDisconnected(int callId) {
    }

    public void callDisconnected(int callId) {

    }

    public void callEndedByUser(int callId) {
    }

    public void callFailed(int callId, int reason) {
    }

    public void callHeld(int callId) {
    }

    public void callIncoming(int callId) {
                //TODO: push your screen here
        Dialog.ask(Dialog.D_YES_NO, "Push my screen here");

    }

    public void callInitiated(int callid) {

        PhoneCall phoneCall = Phone.getCall(callid);
        if (phoneCall != null) {
                //TODO: push your screen here
           Dialog.ask(Dialog.D_YES_NO, "Push my screen here");
         }

    }

    public void callRemoved(int callId) {
    }

    public void callResumed(int callId) {
    }

    public void callWaiting(int callid) {
    }

    public void conferenceCallDisconnected(int callId) {
    }
}