title: Programmatically answer the call
body: <p>I made such code for answering programmatically: </p>
  
  <pre><code>try {
     telephonyService.answerRingingCall();            
  }
  catch (Exception exx) {
       answerPhoneHeadsethook();
  }
  
  private void answerPhoneHeadsethook() {
      // Simulate a press of the headset button to pick up the call
      Intent buttonDown = new Intent(Intent.ACTION_MEDIA_BUTTON);
      buttonDown.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_HEADSETHOOK));
      activity.sendOrderedBroadcast(buttonDown, "android.permission.CALL_PRIVILEGED");
  
      // froyo and beyond trigger on buttonUp instead of buttonDown
      Intent buttonUp = new Intent(Intent.ACTION_MEDIA_BUTTON);
      buttonUp.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_UP, KeyEvent.KEYCODE_HEADSETHOOK));
      activity.sendOrderedBroadcast(buttonUp, "android.permission.CALL_PRIVILEGED");
  } 
  </code></pre>
  
  <p>So...i try to answer with interface ITelephony.aidl, and if it cant, make it with Hadsethook...it working almost on all types of mobile-phones except Htc Sensation (OS: Android 2.3.3)...Can anyone help me to solve this problem! I`ll appreciate any ideas! Thank you! )</p>