How to disconnect incoming call in android by programatically

允我心安 提交于 2019-12-03 17:25:14

You can generate your own activity that handles action "ACTION_ANSWER".

Register your application component as a intent handler.

Here is a blog post which suggest a possible workaround.

Intent buttonUp = new Intent(Intent.ACTION_MEDIA_BUTTON);             
  buttonUp.putExtra(Intent.EXTRA_KEY_EVENT, new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_HEADSETHOOK));
  getContext().sendOrderedBroadcast(buttonUp, "android.permission.CALL_PRIVILEGED");

from

http://androidbridge.blogspot.com/2011/05/how-to-answer-incoming-call-in-android.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!