Can a telephony.Phone object be instantiated through the sdk?

前端 未结 6 1623
我在风中等你
我在风中等你 2020-12-04 18:43

I am trying to get a phone object so that I can call and conference two numbers from within my application.

I have tried using the static PhoneFactory.makeDefa

6条回答
  •  情书的邮戳
    2020-12-04 19:22

    I called it from Activity.onCreate and it crashed several lines after your problem with the following error:

    Default phones haven't been made yet!

    See the Android sources:

    public static Phone getDefaultPhone() {
        if (sLooper != Looper.myLooper()) {
            throw new RuntimeException(
                "PhoneFactory.getDefaultPhone must be called from Looper thread");
        }
    
        if (!sMadeDefaults) {
            throw new IllegalStateException("Default phones haven't been made yet!");
        }
        return sProxyPhone;
    }
    

提交回复
热议问题