How does call app works when the call app is removed from task list (aka Overview screen) in Android?

69 views Asked by At

I learned that following is Overview screen.

enter image description here

I clicked the dialer and dialed a number and then swiped the dialer to the right.

But still the call is on like this.

enter image description here

How is this done?

I am a newbie to Android programming. I am thinking if they had used a back ground thread or a separate service or something else, so that it is never killed accidentally. How is this done?

Please help me. Thanks.

1

There are 1 answers

9
Jeff Hoang On

I believe it is using the Android foreground service. You can checkout how to run it in the doc: https://developer.android.com/guide/components/services.html#Foreground

The difference of foreground from background service is when phone is low on memory, system will not automatically close it to release memory, it should be closed manually by user, which is why you need to have a notification as a way for user to close it when you first create it.