Answer Incoming calls automatcally in android/ Autoanswer incoming call in android/how to programatically answer incoming call in android String state = intnt .getStringExtra(TelephonyManager. EXTRA_STATE ); if (state.equals(TelephonyManager. EXTRA_STATE_RINGING )) { Intent answer = new Intent(Intent. ACTION_MEDIA_BUTTON ); answer.putExtra(Intent. EXTRA_KEY_EVENT , new KeyEvent(KeyEvent. ACTION_UP , KeyEvent. KEYCODE_HEADSETHOOK )); ...
If you are a beginner , then this blog will help you to dive into the basics.