2

How can we disconnect a call in Android. I know this has been asked many times. There are many other answers which state that our app needs to be a system app to disconnect a call but then the answer at this link states that it is not so. But, even the answer there does not help to disconnect the call.

Then I saw that SDK 23 adds a new class Call which the Android document says can be used to handle calls. It has a function called disconnect(). So, how can this be used, if our app is not the dialer app? I only need the data to cut/answer the call. (Don't want to become the default dialer app, nor the system app) https://developer.android.com/reference/android/telecom/Call.html#disconnect()

Could I be guided towards what is the latest information in this regard? For both Marshmallow and pre-Marshmallow devices. I feel the solution to both might be different.

Not sure of the solution for pre-Marshmallow, but for M+ I feel the Call class is to be used.

Community
  • 1
  • 1
Ankit Aggarwal
  • 787
  • 1
  • 9
  • 15
  • Possible duplicate of [End call in android programmatically](http://stackoverflow.com/questions/18065144/end-call-in-android-programmatically) – JimmyB Jul 04 '16 at 09:58
  • @JimmyB That answer does not work anymore. Have you used it yourself? This is an important part of my app. – Ankit Aggarwal Jul 04 '16 at 09:59
  • "does not work anymore" - Then please clarify in your question what your problem is. What does work? Are you looking for Marshmallow or pre-Marshmallow solutions? – JimmyB Jul 04 '16 at 10:01
  • @JimmyB Thanks. I have edited the question. Does it seem clear now? Please tell if otherwise. Cheers! – Ankit Aggarwal Jul 04 '16 at 10:05

0 Answers0