• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Call Hang up

sourabh_d

Lurker
Oct 29, 2009
5
0
Hello,

I am devloping an application where i want to programatically
connect and disconnect the call. I am able to connect the call
by simply using the

Intent intent = new Intent(Intent.ACTION_CALL,Uri.parse("tel:+"+text.getText().toString()));

But i dont know how to disconnect the call through program since
there is no direct api to disconnect the call. Is there any other way to
do this. Plz provide some guidance regarding the same.


Regards,
Sourabh
 
If the intent owns the phonecall (so to speak) then maybe deleting the intent will hang up the call and clean up?

something like:
intent = null;

??

This doesn't delete the intent. The JVM won't delete it until it is garbage collected, but it probably won't do that as long as the activity is running.

I don't know enough about the Activity model to answer your question, but from what I understand, I believe once you call a new activity (your phone call), you surrender all control to that activity. In other words, it may not be possible to end a call.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones