Can a telephony.Phone object be instantiated through the sdk?
Posted
by Tyler
on Stack Overflow
See other posts from Stack Overflow
or by Tyler
Published on 2010-01-27T00:28:52Z
Indexed on
2010/03/23
1:01 UTC
Read the original article
Hit count: 724
android-sdk
|android
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.makeDefaultPhones((Context)this) but have not had any luck.
String phoneFactoryName = "com.android.internal.telephony.PhoneFactory";
String phoneName = "com.android.internal.telephony.Phone";
Class phoneFactoryClass = Class.forName(phoneFactoryName);
Class phoneClass = Class.forName(phoneName);
Method getDefaultPhone = phoneFactoryClass.getMethod("getDefaultPhone");
Object phoneObject = getDefaultPhone.invoke(null);
Error - Caused by java.lang.RuntimeException: PhoneFactory.getDefaultPhone must be called from Looper thread
© Stack Overflow or respective owner