Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to come back to my application after ACTION_CALL in android

I've got one question regarding the intent action ACTION_CALL.

What is the correct way of getting back to the own application/activity after the user ends the call?

Intent intent = new Intent(Intent.ACTION_CALL);
       intent.setData(Uri.parse("tel:" +m1));

startActivity(intent);

I have made the call using the above code. Please provide me with a solution to call my own activity after the call action.

like image 753
user649467 Avatar asked Dec 28 '25 03:12

user649467


1 Answers

unfortunately some phones have settings to force going into for example the Call Log after a call...

However, you can run a loop after your startActivity to check TelephonyManager.getCallState, and when it's again TelephonyManager.CALL_STATE_IDLE, you can restart your own Activity

be sure to add some sleep to the loop

like image 197
ᅙᄉᅙ Avatar answered Dec 30 '25 18:12

ᅙᄉᅙ



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!