I'm wondering how to end incoming/outgoing call programatically in android. I tried the solution posted here but I got no luck in getting it work.
I am using following code to disconnect call using the BroadCast...
try{
TelephonyManager manager = (TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE);
Class c = Class.forName(manager.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
ITelephony telephony = (ITelephony)m.invoke(manager);
telephony.endCall();
} catch(Exception e){
Log.d("",e.getMessage());
}
but I got error:
NO such method name 'getITelephony' in ICS call is not disconnecting