At first, it sound like a simple thing to do but I found it no so simple.
What I’m trying to achieve is to have my android app return to a certain state after an it went to the background upon an incoming call.
The question is, what is the best way to know whether my app went to foreground after the user rejected or ended an incoming call (that occurred while my app was in the foreground)?
I know I can use broadcast receivers to identify incoming calls.
Thanks.
You should look at Activity Lifecycle
Once you app is resumed/restarted onResume/onRestart would be called, you do not need to listen for broadcast unless you are doing something with audio that will hamper the ongoing call.