0

How to answer a call programatically.

I have tried to implement the below code using TelephonyManager.

TelephonyManager tm = (TelephonyManager) mContext
        .getSystemService(Context.TELEPHONY_SERVICE);

if (tm == null) {
    // whether you want to handle this is up to you really
    throw new NullPointerException("tm == null");
}
tm.answerRingingCall();

But, It is not working. Is there any other ways to do the same.

Vadim Kotov
  • 7,766
  • 8
  • 46
  • 61
Vineesh TP
  • 7,389
  • 10
  • 58
  • 118
  • Refer this http://stackoverflow.com/questions/36565820/android-call-answering-programatically – Vishal Senjaliya May 08 '17 at 12:14
  • This guy has explained beautifully-> http://stackoverflow.com/questions/26924618/how-can-incoming-calls-be-answered-programmatically-in-android-5-0-lollipop – Yashika May 08 '17 at 12:18

0 Answers0