4

i wish to end an incoming call programmatically through my app. after searching i got the code which uses com.android.internal.telephony but says it wont work for versions higher than 2.3. i got the code for attending a call through key press event

 Intent i = new Intent(Intent.ACTION_MEDIA_BUTTON);
                KeyEvent event = new KeyEvent(KeyEvent.ACTION_DOWN,KeyEvent.KEYCODE_HEADSETHOOK);
                i.putExtra(Intent.EXTRA_KEY_EVENT, event );
                context.sendOrderedBroadcast(i, null);

is there any similar method available for ending a call?? plz help

Jesbin MJ
  • 3,219
  • 7
  • 23
  • 28

1 Answers1

0

check out this link for carrying it out on a honeycomb device after that its deprecated and it won't work however,here's a trick to handle that

http://prasanta-paul.blogspot.in/2010/09/call-control-in-android.html

Solution

  1. You make a window appear as soon as you get a broadcast for incoming call and place your END call button on the same position as the default android end call button in center so user presses your button but you will pass the event below that window and hence call ends by android but You become a winner..

heres a tutorial for creating a window anywhere you want to without starting an activity for it...

http://www.piwai.info/chatheads-basics/#AndroidHead

cafebabe1991
  • 4,928
  • 2
  • 34
  • 42