I have code which is supposed to answer the phone and hang up right away when someone calls the phone. I get no errors and no force close when the call comes in from a diffe
Add following code to AndroidManifest.xml
(add it after READ_PHONE_STATE and before MODIFY_PHONE_STATE")
and use it for EndCall :
private void endCall()
{
Class c = TelephonyManager.class;
Method getITelephonyMethod = null;
try {
getITelephonyMethod = c.getDeclaredMethod("getITelephony",(Class[]) null);
getITelephonyMethod.setAccessible(true);
ITelephony iTelephony = (ITelephony) getITelephonyMethod.invoke(tm, (Object[]) null);
iTelephony.endCall();
} catch (Exception e) {
}
}